Skip to contents

Note that some famous non-standard distributions (Tweedie, SHASHo, COM-Pois, Cauchy) are already implemented in RTMB; check the distributions listed here.

Continuous distributions

  • bccg(mu, sigma, nu): Box-Cox Cole and Green distribution parameterised by location mu, scale sigma, and skewness nu

  • bcpe(mu, sigma, nu, tau): Box-Cox power exponential distribution parameterised by location mu, scale sigma, nu, and tau

  • bct(mu, sigma, nu, tau): Box-Cox t-distribution parameterised by location mu, scale sigma, skewness nu, and degrees of freedom tau

  • betaprime(shape1, shape2): Beta prime distribution parameterised in terms of shape1 and shape2 of the corresponding Beta distribution

  • beta2(mu, phi): Beta distribution reparameterised by mean mu and precision phi

  • exgauss(mu, sigma, lambda): Exponentially modified Gaussian distribution parameterised by location mu, scale sigma, and rate lambda

  • foldnorm(mu, sigma): Folded normal distribution parameterised by location mu and scale sigma

  • frechet(mu, sigma, alpha): Frechet distribution parameterised by location mu, scale sigma, and shape alpha

  • gamma2(mean, sd): Gamma distribution reparameterised by mean and standard deviation

  • gengamma(mu, sigma, nu): Generalised gamma distribution parameterised by location mu, scale sigma, and skewness nu

  • gev(mu, sigma, xi): Generalised extreme value distribution parameterised by location mu, scale sigma, and shape xi

  • gpd(mu, sigma, xi): Generalised Pareto distribution parameterised by threshold mu, scale sigma, and shape xi

  • gompertz(eta, b): Gompertz distribution parameterised by shape eta and rate b

  • gumbel(location, scale): Gumbel distribution parameterised by location and scale

  • halfcauchy(sigma): Half-Cauchy distribution parameterised by scale sigma, a standard weakly informative prior for hierarchical standard deviations

  • halft(df, sigma): Half-t distribution parameterised by degrees of freedom df and scale sigma

  • invchisq(df, scale): Inverse Chi-squared distribution parameterised by degrees of freedom df and optional scale

  • invgamma(shape, rate, scale): Inverse gamma distribution parameterised by shape and either rate or scale of the corresponding gamma distribution

  • invgauss(mean, shape): Inverse Gaussian distribution parameterised by mean and shape

  • jsu(mu, sigma, nu, tau): Johnson SU distribution parameterised by location mu, scale sigma, skewness nu, and kurtosis tau

  • jsu2(mu, sigma, nu, tau): Johnson SU distribution reparameterised by mean mu, standard deviation sigma, skewness nu, and kurtosis tau

  • kumar(a, b): Kumaraswamy distribution parameterised by shape parameters a and b

  • laplace(mu, b): Laplace distribution parameterised by location mu and scale b

  • llogis(alpha, beta): Log-logistic distribution parameterised by scale alpha (equal to the median) and shape beta

  • oibeta(shape1, shape2, oneprob): One-inflated beta distribution parameterised by shape parameters shape1, shape2 and one-probability oneprob

  • oibeta2(mu, phi, oneprob): One-inflated beta distribution reparameterised by mean mu, precision phi, and one-probability oneprob

  • pareto(mu): Pareto distribution parameterised by mu

  • powerexp(mu, sigma, nu): Power exponential distribution parameterised by mean mu, standard deviation sigma and shape nu

  • powerexp2(mu, sigma, nu): Power exponential distribution reparameterised by location mu, scale sigma and shape nu

  • pgweibull(scale, shape, powershape): Power generalised Weibull distribution parameterised by scale, shape and powershape

  • skewnorm(xi, omega, alpha): Skew normal distribution parameterised by location xi, scale omega and skewness alpha

  • skewnorm2(mean, sd, alpha): Skew normal distribution reparameterised by mean, standard deviation and skewness alpha

  • skewt(mu, sigma, skew, df): Skew t-distribution parameterised by location mu, scale sigma, skewness skew and degrees of freedom df

  • skewt2(mean, sd, skew, df): Skew t-distribution reparameterised by mean, standard deviation, skewness skew and degrees of freedom df

  • truncnorm(mean, sd, min, max): Truncated normal distribution parameterised by mean, standard deviation, lower bound min and upper bound max

  • trunct(df, min, max): Truncated t-distribution parameterised by degrees of freedom df, lower bound min and upper bound max

  • trunct2(df, mu, sigma, min, max): Truncated t-distribution parameterised location mu, scale sigma, degrees of freedom df, lower bound min and upper bound max

  • t2(mu, sigma, df): Non-central and scaled t-distribution parameterised by location mu, scale sigma and degrees of freedom df

  • vm(mu, kappa): Von Mises distribution parameterised by mean direction mu and concentration kappa

  • wrpcauchy(mu, rho): Wrapped Cauchy distribution parameterised by mean direction mu and concentration rho

  • zibeta(shape1, shape2, zeroprob): Zero-inflated beta distribution parameterised by shape parameters shape1, shape2 and zero-probability zeroprob

  • zibeta2(mu, phi, zeroprob): Zero-inflated beta distribution reparameterised by mean mu, precision phi, and zero-probability zeroprob

  • zigamma(shape, scale, zeroprob): Zero-inflated gamma distribution parameterised by shape, scale, and zero-probability zeroprob

  • zigamma2(mean, sd, zeroprob): Zero-inflated gamma distribution reparameterised by mean, standard deviation, and zero-probability zeroprob

  • ziinvgauss(mean, shape, zeroprob): Zero-inflated inverse Gaussian distribution parameterised by mean, shape, and zero-probability zeroprob

  • zilnorm(meanlog, sdlog, zeroprob): Zero-inflated log normal distribution parameterised by meanlog, sdlog, and zero-probability zeroprob

  • ziweibull(shape, scale, zeroprob): Zero-inflated Weibull distribution parameterised by shape, scale, and zero-probability zeroprob

  • zoibeta(shape1, shape2, zeroprob, oneprob): Zero- and one-inflated beta distribution parameterised by shape parameters shape1, shape2, zero-probability zeroprob and one-probability oneprob

  • zoibeta2(mu, phi, zeroprob, oneprob): Zero- and one-inflated beta distribution reparameterised by mean mu, precision phi, zero-probability zeroprob and one-probability oneprob

Discrete distributions

Multivariate distributions

  • dirichlet(alpha): Dirichlet distribution parameterised by concentration parameter vector alpha

  • dirmult(size, alpha): Dirichlet-multinomial distribution parameterised by size and concentration parameters alpha

  • mvt(mu, Sigma, df): Multivariate t-distribution parameterised by location mu, scale matrix Sigma and degrees of freedom df

  • vmf(mu, kappa): Multivariate von Mises-Fisher distribution parameterised by unit mean vector mu and concentration kappa

  • vmf2(theta): Multivariate von Mises-Fisher distribution parameterised by parameter theta equal to unit mean vector mu times concentration scalar kappa

  • wishart(nu, Sigma): Wishart distribution parameterised by degrees of freedom nu and scale matrix Sigma

Copulas

Bivariate copulas can be implemented in a modular way using the dcopula function together with one of the copula constructors below. Available copula constructors are:

For a circular and a linear margin, such as turning angles and step lengths, there are two circular-linear copula constructors. The circular margin has to be the first one in dcopula.

  • cjw(g, ...) (Johnson-Wehrly copula with circular binding density g, e.g. dvm or dwrpcauchy)
  • cfold(copula) (folds one of the copulas above into a circular-linear copula that is symmetric in the sign of the angle)

For bivariate copulas with discrete margins, use the ddcopula function instead. In this case, instead of copula densities, copula CDFs are needed. The available constructors for this are:

Multivariate copulas are also possible using the dmvcopula function together with one of the multivariate copula constructors below. Currently, only the multivariate Gaussian copula is implemented in two ways:

  • cmvgauss(R) (multivariate Gaussian copula parameterised by a correlation matrix)
  • cgmrf(Q) (multivariate Gaussian copula parameterised by an inverse correlation matrix)