Positive Continuous Distributions
The positive continuous probability functions have support on the positive real numbers.
Lognormal distribution
Probability density function
If \(\mu \in \mathbb{R}\) and \(\sigma \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{LogNormal}(y|\mu,\sigma) = \frac{1}{\sqrt{2 \pi} \ \sigma} \, \frac{1}{y} \ \exp \! \left( - \, \frac{1}{2} \, \left( \frac{\log y - \mu}{\sigma} \right)^2 \right) . \end{equation*}\]
Sampling statement
y ~
lognormal
(mu, sigma)
Increment target log probability density with lognormal_lupdf(y | mu, sigma)
.
Stan functions
real
lognormal_lpdf
(reals y | reals mu, reals sigma)
The log of the lognormal density of y given location mu and scale sigma
real
lognormal_lupdf
(reals y | reals mu, reals sigma)
The log of the lognormal density of y given location mu and scale sigma dropping constant additive terms
real
lognormal_cdf
(reals y | reals mu, reals sigma)
The cumulative lognormal distribution function of y given location mu and scale sigma
real
lognormal_lcdf
(reals y | reals mu, reals sigma)
The log of the lognormal cumulative distribution function of y given location mu and scale sigma
real
lognormal_lccdf
(reals y | reals mu, reals sigma)
The log of the lognormal complementary cumulative distribution function of y given location mu and scale sigma
R
lognormal_rng
(reals mu, reals sigma)
Generate a lognormal variate with location mu and scale sigma; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Chi-square distribution
Probability density function
If \(\nu \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{ChiSquare}(y|\nu) = \frac{2^{-\nu/2}} {\Gamma(\nu / 2)} \, y^{\nu/2 - 1} \, \exp \! \left( -\, \frac{1}{2} \, y \right) . \end{equation*}\]
Sampling statement
y ~
chi_square
(nu)
Increment target log probability density with chi_square_lupdf(y | nu)
.
Stan functions
real
chi_square_lpdf
(reals y | reals nu)
The log of the Chi-square density of y given degrees of freedom nu
real
chi_square_lupdf
(reals y | reals nu)
The log of the Chi-square density of y given degrees of freedom nu dropping constant additive terms
real
chi_square_cdf
(reals y | reals nu)
The Chi-square cumulative distribution function of y given degrees of freedom nu
real
chi_square_lcdf
(reals y | reals nu)
The log of the Chi-square cumulative distribution function of y given degrees of freedom nu
real
chi_square_lccdf
(reals y | reals nu)
The log of the complementary Chi-square cumulative distribution function of y given degrees of freedom nu
R
chi_square_rng
(reals nu)
Generate a Chi-square variate with degrees of freedom nu; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Inverse chi-square distribution
Probability density function
If \(\nu \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{InvChiSquare}(y \, | \, \nu) = \frac{2^{-\nu/2}} {\Gamma(\nu / 2)} \, y^{-\nu/2 - 1} \, \exp\! \left( \! - \, \frac{1}{2} \, \frac{1}{y} \right) . \end{equation*}\]
Sampling statement
y ~
inv_chi_square
(nu)
Increment target log probability density with inv_chi_square_lupdf(y | nu)
.
Stan functions
real
inv_chi_square_lpdf
(reals y | reals nu)
The log of the inverse Chi-square density of y given degrees of freedom nu
real
inv_chi_square_lupdf
(reals y | reals nu)
The log of the inverse Chi-square density of y given degrees of freedom nu dropping constant additive terms
real
inv_chi_square_cdf
(reals y | reals nu)
The inverse Chi-squared cumulative distribution function of y given degrees of freedom nu
real
inv_chi_square_lcdf
(reals y | reals nu)
The log of the inverse Chi-squared cumulative distribution function of y given degrees of freedom nu
real
inv_chi_square_lccdf
(reals y | reals nu)
The log of the inverse Chi-squared complementary cumulative distribution function of y given degrees of freedom nu
R
inv_chi_square_rng
(reals nu)
Generate an inverse Chi-squared variate with degrees of freedom nu; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Scaled inverse chi-square distribution
Probability density function
If \(\nu \in \mathbb{R}^+\) and \(\sigma \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{ScaledInvChiSquare}(y|\nu,\sigma) = \frac{(\nu / 2)^{\nu/2}} {\Gamma(\nu / 2)} \, \sigma^{\nu} \, y^{-(\nu/2 + 1)} \, \exp \! \left( \! - \, \frac{1}{2} \, \nu \, \sigma^2 \, \frac{1}{y} \right) . \end{equation*}\]
Sampling statement
y ~
scaled_inv_chi_square
(nu, sigma)
Increment target log probability density with scaled_inv_chi_square_lupdf(y | nu, sigma)
.
Stan functions
real
scaled_inv_chi_square_lpdf
(reals y | reals nu, reals sigma)
The log of the scaled inverse Chi-square density of y given degrees of freedom nu and scale sigma
real
scaled_inv_chi_square_lupdf
(reals y | reals nu, reals sigma)
The log of the scaled inverse Chi-square density of y given degrees of freedom nu and scale sigma dropping constant additive terms
real
scaled_inv_chi_square_cdf
(reals y | reals nu, reals sigma)
The scaled inverse Chi-square cumulative distribution function of y given degrees of freedom nu and scale sigma
real
scaled_inv_chi_square_lcdf
(reals y | reals nu, reals sigma)
The log of the scaled inverse Chi-square cumulative distribution function of y given degrees of freedom nu and scale sigma
real
scaled_inv_chi_square_lccdf
(reals y | reals nu, reals sigma)
The log of the scaled inverse Chi-square complementary cumulative distribution function of y given degrees of freedom nu and scale sigma
R
scaled_inv_chi_square_rng
(reals nu, reals sigma)
Generate a scaled inverse Chi-squared variate with degrees of freedom nu and scale sigma; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Exponential distribution
Probability density function
If \(\beta \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{Exponential}(y|\beta) = \beta \, \exp ( - \beta \, y ) . \end{equation*}\]
Sampling statement
y ~
exponential
(beta)
Increment target log probability density with exponential_lupdf(y | beta)
.
Stan functions
real
exponential_lpdf
(reals y | reals beta)
The log of the exponential density of y given inverse scale beta
real
exponential_lupdf
(reals y | reals beta)
The log of the exponential density of y given inverse scale beta dropping constant additive terms
real
exponential_cdf
(reals y | reals beta)
The exponential cumulative distribution function of y given inverse scale beta
real
exponential_lcdf
(reals y | reals beta)
The log of the exponential cumulative distribution function of y given inverse scale beta
real
exponential_lccdf
(reals y | reals beta)
The log of the exponential complementary cumulative distribution function of y given inverse scale beta
R
exponential_rng
(reals beta)
Generate an exponential variate with inverse scale beta; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Gamma distribution
Probability density function
If \(\alpha \in \mathbb{R}^+\) and \(\beta \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{Gamma}(y|\alpha,\beta) = \frac{\beta^{\alpha}} {\Gamma(\alpha)} \, y^{\alpha - 1} \exp(-\beta \, y) . \end{equation*}\]
Sampling statement
y ~
gamma
(alpha, beta)
Increment target log probability density with gamma_lupdf(y | alpha, beta)
.
Stan functions
real
gamma_lpdf
(reals y | reals alpha, reals beta)
The log of the gamma density of y given shape alpha and inverse scale beta
real
gamma_lupdf
(reals y | reals alpha, reals beta)
The log of the gamma density of y given shape alpha and inverse scale beta dropping constant additive terms
real
gamma_cdf
(reals y | reals alpha, reals beta)
The cumulative gamma distribution function of y given shape alpha and inverse scale beta
real
gamma_lcdf
(reals y | reals alpha, reals beta)
The log of the cumulative gamma distribution function of y given shape alpha and inverse scale beta
real
gamma_lccdf
(reals y | reals alpha, reals beta)
The log of the complementary cumulative gamma distribution function of y given shape alpha and inverse scale beta
R
gamma_rng
(reals alpha, reals beta)
Generate a gamma variate with shape alpha and inverse scale beta; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Inverse gamma Distribution
Probability density function
If \(\alpha \in \mathbb{R}^+\) and \(\beta \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{InvGamma}(y|\alpha,\beta) = \frac{\beta^{\alpha}} {\Gamma(\alpha)} \ y^{-(\alpha + 1)} \, \exp \! \left( \! - \beta \, \frac{1}{y} \right) . \end{equation*}\]
Sampling statement
y ~
inv_gamma
(alpha, beta)
Increment target log probability density with inv_gamma_lupdf(y | alpha, beta)
.
Stan functions
real
inv_gamma_lpdf
(reals y | reals alpha, reals beta)
The log of the inverse gamma density of y given shape alpha and scale beta
real
inv_gamma_lupdf
(reals y | reals alpha, reals beta)
The log of the inverse gamma density of y given shape alpha and scale beta dropping constant additive terms
real
inv_gamma_cdf
(reals y | reals alpha, reals beta)
The inverse gamma cumulative distribution function of y given shape alpha and scale beta
real
inv_gamma_lcdf
(reals y | reals alpha, reals beta)
The log of the inverse gamma cumulative distribution function of y given shape alpha and scale beta
real
inv_gamma_lccdf
(reals y | reals alpha, reals beta)
The log of the inverse gamma complementary cumulative distribution function of y given shape alpha and scale beta
R
inv_gamma_rng
(reals alpha, reals beta)
Generate an inverse gamma variate with shape alpha and scale beta; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Weibull distribution
Probability density function
If \(\alpha \in \mathbb{R}^+\) and \(\sigma \in \mathbb{R}^+\), then for \(y \in [0,\infty)\), \[\begin{equation*} \text{Weibull}(y|\alpha,\sigma) = \frac{\alpha}{\sigma} \, \left( \frac{y}{\sigma} \right)^{\alpha - 1} \, \exp \! \left( \! - \left( \frac{y}{\sigma} \right)^{\alpha} \right) . \end{equation*}\]
Note that if \(Y \propto \text{Weibull}(\alpha,\sigma)\), then \(Y^{-1} \propto \text{Frechet}(\alpha,\sigma^{-1})\).
Sampling statement
y ~
weibull
(alpha, sigma)
Increment target log probability density with weibull_lupdf(y | alpha, sigma)
.
Stan functions
real
weibull_lpdf
(reals y | reals alpha, reals sigma)
The log of the Weibull density of y given shape alpha and scale sigma
real
weibull_lupdf
(reals y | reals alpha, reals sigma)
The log of the Weibull density of y given shape alpha and scale sigma dropping constant additive terms
real
weibull_cdf
(reals y | reals alpha, reals sigma)
The Weibull cumulative distribution function of y given shape alpha and scale sigma
real
weibull_lcdf
(reals y | reals alpha, reals sigma)
The log of the Weibull cumulative distribution function of y given shape alpha and scale sigma
real
weibull_lccdf
(reals y | reals alpha, reals sigma)
The log of the Weibull complementary cumulative distribution function of y given shape alpha and scale sigma
R
weibull_rng
(reals alpha, reals sigma)
Generate a weibull variate with shape alpha and scale sigma; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Frechet distribution
Probability density function
If \(\alpha \in \mathbb{R}^+\) and \(\sigma \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{Frechet}(y|\alpha,\sigma) = \frac{\alpha}{\sigma} \, \left( \frac{y}{\sigma} \right)^{-\alpha - 1} \, \exp \! \left( \! - \left( \frac{y}{\sigma} \right)^{-\alpha} \right) . \end{equation*}\]
Note that if \(Y \propto \text{Frechet}(\alpha,\sigma)\), then \(Y^{-1} \propto \text{Weibull}(\alpha,\sigma^{-1})\).
Sampling statement
y ~
frechet
(alpha, sigma)
Increment target log probability density with frechet_lupdf(y | alpha, sigma)
.
Stan functions
real
frechet_lpdf
(reals y | reals alpha, reals sigma)
The log of the Frechet density of y given shape alpha and scale sigma
real
frechet_lupdf
(reals y | reals alpha, reals sigma)
The log of the Frechet density of y given shape alpha and scale sigma dropping constant additive terms
real
frechet_cdf
(reals y | reals alpha, reals sigma)
The Frechet cumulative distribution function of y given shape alpha and scale sigma
real
frechet_lcdf
(reals y | reals alpha, reals sigma)
The log of the Frechet cumulative distribution function of y given shape alpha and scale sigma
real
frechet_lccdf
(reals y | reals alpha, reals sigma)
The log of the Frechet complementary cumulative distribution function of y given shape alpha and scale sigma
R
frechet_rng
(reals alpha, reals sigma)
Generate a Frechet variate with shape alpha and scale sigma; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.
Rayleigh distribution
Probability density function
If \(\sigma \in \mathbb{R}^+\), then for \(y \in [0,\infty)\), \[\begin{equation*} \text{Rayleigh}(y|\sigma) = \frac{y}{\sigma^2} \exp(-y^2 / 2\sigma^2) \!. \end{equation*}\]
Sampling statement
y ~
rayleigh
(sigma)
Increment target log probability density with rayleigh_lupdf(y | sigma)
.
Stan functions
real
rayleigh_lpdf
(reals y | reals sigma)
The log of the Rayleigh density of y given scale sigma
real
rayleigh_lupdf
(reals y | reals sigma)
The log of the Rayleigh density of y given scale sigma dropping constant additive terms
real
rayleigh_cdf
(real y | real sigma)
The Rayleigh cumulative distribution of y given scale sigma
real
rayleigh_lcdf
(real y | real sigma)
The log of the Rayleigh cumulative distribution of y given scale sigma
real
rayleigh_lccdf
(real y | real sigma)
The log of the Rayleigh complementary cumulative distribution of y given scale sigma
R
rayleigh_rng
(reals sigma)
Generate a Rayleigh variate with scale sigma; may only be used in generated quantities block. For a description of argument and return types, see section vectorized PRNG functions.
Log-logistic distribution
Probability density function
If \(\alpha, \beta \in \mathbb{R}^+\), then for \(y \in \mathbb{R}^+\), \[\begin{equation*} \text{Log-Logistic}(y|\alpha,\beta) = \frac{\ \left(\frac{\beta}{\alpha}\right) \left(\frac{y}{\alpha}\right)^{\beta-1}\ }{\left(1 + \left(\frac{y}{\alpha}\right)^\beta\right)^2} . \end{equation*}\]
Sampling statement
y ~
loglogistic
(alpha, beta)
Increment target log probability density with unnormalized version of loglogistic_lpdf(y | alpha, beta)
Stan functions
real
loglogistic_lpdf
(reals y | reals alpha, reals beta)
The log of the log-logistic density of y given scale alpha and shape beta
real
loglogistic_cdf
(reals y | reals alpha, reals beta)
The log-logistic cumulative distribution function of y given scale alpha and shape beta
R
loglogistic_rng
(reals alpha, reals beta)
Generate a log-logistic variate with scale alpha and shape beta; may only be used in transformed data and generated quantities blocks. For a description of argument and return types, see section vectorized PRNG functions.