TMB Documentation  v1.9.1
distributions_R.hpp File Reference

Probability distribution functions. More...

Go to the source code of this file.

## Functions

template<class Type >
Type besselI (Type x, Type nu)
besselI function (same as besselI from R). More...

template<class Type >
Type besselJ (Type x, Type nu)
besselJ function (same as besselJ from R). More...

template<class Type >
Type besselK (Type x, Type nu)
besselK function (same as besselK from R). More...

template<class Type >
Type besselY (Type x, Type nu)
besselY function (same as besselY from R). More...

template<class Type >
Type compois_calc_loglambda (Type logmean, Type nu)
Conway-Maxwell-Poisson. Calculate log(lambda) from log(mean). More...

template<class Type >
Type compois_calc_logZ (Type loglambda, Type nu)
Conway-Maxwell-Poisson log normalizing constant. More...

template<class Type >
Type dbeta (Type x, Type shape1, Type shape2, int give_log)
Probability density function of the beta distribution. More...

template<class Type >
Type dbinom (Type k, Type size, Type prob, int give_log=0)
Probability mass function of the binomial distribution. More...

template<class Type >
Type dbinom_robust (Type k, Type size, Type logit_p, int give_log=0)
Density of binomial distribution parameterized via logit(prob) More...

template<class T1 , class T2 , class T3 >
T1 dcompois (T1 x, T2 mode, T3 nu, int give_log=0)
Conway-Maxwell-Poisson. Calculate density. More...

template<class T1 , class T2 , class T3 >
T1 dcompois2 (T1 x, T2 mean, T3 nu, int give_log=0)
Conway-Maxwell-Poisson. Calculate density parameterized via the mean. More...

template<class Type >
Type df (Type x, Type df1, Type df2, int give_log)
Probability density function of the Fisher distribution. More...

template<class Type >
Type dlogis (Type x, Type location, Type scale, int give_log)
Probability density function of the logistic distribution. More...

template<class Type >
Type dmultinom (vector< Type > x, vector< Type > p, int give_log=0)
Probability mass function of the multinomial distribution. More...

template<class Type >
Type dsn (Type x, Type alpha, int give_log=0)
Probability density function of the skew-normal distribution. More...

template<class Type >
Type dt (Type x, Type df, int give_log)
Probability density function of the Student t-distribution. More...

template<class Type >
Type dtweedie (Type y, Type mu, Type phi, Type p, int give_log=0)
dtweedie function (same as dtweedie.series from R package 'tweedie'). More...

template<class Type >
Type pbeta (Type q, Type shape1, Type shape2)
Distribution function of the beta distribution (following R argument convention). More...

template<class Type >
Type pgamma (Type q, Type shape, Type scale=1.)
Distribution function of the gamma distribution (following R argument convention).

template<class Type >
Type pnorm (Type q, Type mean=0., Type sd=1.)
Distribution function of the normal distribution (following R argument convention).

template<class Type >
Type ppois (Type q, Type lambda)
Distribution function of the poisson distribution (following R argument convention).

template<class Type >
Type qbeta (Type p, Type shape1, Type shape2)
Quantile function of the beta distribution (following R argument convention). More...

template<class Type >
Type qgamma (Type q, Type shape, Type scale=1.)
Quantile function of the gamma distribution (following R argument convention).

template<class Type >
Type qnorm (Type p, Type mean=0., Type sd=1.)
Quantile function of the normal distribution (following R argument convention).

template<class Type >
Type rbeta (Type shape1, Type shape2)
Simulate from a beta distribution.

template<class Type >
Type rbinom (Type size, Type prob)
Simulate from a binomial distribution.

template<class Type >
Type rcompois (Type mode, Type nu)
Simulate from a Conway-Maxwell-Poisson distribution.

template<class Type >
Type rcompois2 (Type mean, Type nu)
Simulate from a Conway-Maxwell-Poisson distribution.

template<class Type >
Type rexp (Type rate)
Simulate from an exponential distribution.

template<class Type >
Type rf (Type df1, Type df2)
Simulate from an F distribution.

template<class Type >
Type rgamma (Type shape, Type scale)
Simulate from a gamma distribution.

template<class Type >
Type rlogis (Type location, Type scale)
Simulate from a logistic distribution.

template<class Type >
Type rnorm (Type mu, Type sigma)
Simulate from a normal distribution.

template<class Type >
Type rpois (Type mu)
Simulate from a Poisson distribution.

template<class Type >
Type rt (Type df)
Simulate from a Student's t distribution.

template<class Type >
Type rtweedie (Type mu, Type phi, Type p)
Simulate from tweedie distribution.

template<class Type >
Type runif (Type a, Type b)
Simulate from a uniform distribution.

template<class Type >
Type rweibull (Type shape, Type scale)
Simulate from a Weibull distribution.

Exponential distribution.

Functions relative to the exponential distribution.

template<class Type >
Type pexp (Type x, Type rate)
Cumulative distribution function of the exponential distribution. More...

template<class Type >
Type dexp (Type x, Type rate, int give_log=0)
Probability density function of the exponential distribution. More...

template<class Type >
Type qexp (Type p, Type rate)
Inverse cumulative distribution function of the exponential distribution. More...

Weibull distribution.

Functions relative to the Weibull distribution.

template<class Type >
Type pweibull (Type x, Type shape, Type scale)
Cumulative distribution function of the Weibull distribution. More...

template<class Type >
Type dweibull (Type x, Type shape, Type scale, int give_log=0)
Probability density function of the Weibull distribution. More...

template<class Type >
Type qweibull (Type p, Type shape, Type scale)
Inverse cumulative distribution function of the Weibull distribution. More...

Sinh-asinh distribution.

Functions relative to the sinh-asinh distribution.

template<class Type >
Type dSHASHo (Type x, Type mu, Type sigma, Type nu, Type tau, int give_log=0)
Probability density function of the sinh-asinh distribution. More...

template<class Type >
Type pSHASHo (Type q, Type mu, Type sigma, Type nu, Type tau, int give_log=0)
Cumulative distribution function of the sinh-asinh distribution. More...

template<class Type >
Type qSHASHo (Type p, Type mu, Type sigma, Type nu, Type tau, int log_p=0)
Quantile function of the sinh-asinh distribution. More...

template<class Type >
Type norm2SHASHo (Type x, Type mu, Type sigma, Type nu, Type tau, int log_p=0)
Transforms a normal variable into a sinh-asinh variable. More...

## Detailed Description

Probability distribution functions.

Definition in file distributions_R.hpp.

## § compois_calc_loglambda()

template<class Type >
 Type compois_calc_loglambda ( Type logmean, Type nu )

Conway-Maxwell-Poisson. Calculate log(lambda) from log(mean).

Parameters
 logmean $$\log(E[X])$$ nu $$\nu$$
Returns
$$\log \lambda$$

Definition at line 596 of file distributions_R.hpp.

## § compois_calc_logZ()

template<class Type >
 Type compois_calc_logZ ( Type loglambda, Type nu )

Conway-Maxwell-Poisson log normalizing constant.

$Z(\lambda, \nu) = \sum_{i=0}^{\infty} \frac{\lambda^i}{(i!)^\nu}$

.

Parameters
 loglambda $$\log(\lambda)$$ nu $$\nu$$
Returns
$$\log Z(\lambda, \nu)$$

Definition at line 578 of file distributions_R.hpp.

License: GPL v2