Positive Continuous Distributions

The positive continuous probability functions have support on the positive real numbers.

Lognormal distribution

Probability density function

If μR and σR+, then for yR+, LogNormal(y|μ,σ)=12π σ1y exp(12(logyμσ)2).

Distribution statement

y ~ lognormal(mu, sigma)

Increment target log probability density with lognormal_lupdf(y | mu, sigma).

Available since 2.0

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

Available since 2.12

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

Available since 2.25

real lognormal_cdf(reals y | reals mu, reals sigma)
The cumulative lognormal distribution function of y given location mu and scale sigma

Available since 2.0

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.22

Chi-square distribution

Probability density function

If νR+, then for yR+, ChiSquare(y|ν)=2ν/2Γ(ν/2)yν/21exp(12y).

Distribution statement

y ~ chi_square(nu)

Increment target log probability density with chi_square_lupdf(y | nu).

Available since 2.0

Stan functions

real chi_square_lpdf(reals y | reals nu)
The log of the Chi-square density of y given degrees of freedom nu

Available since 2.12

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

Available since 2.25

real chi_square_cdf(reals y | reals nu)
The Chi-square cumulative distribution function of y given degrees of freedom nu

Available since 2.0

real chi_square_lcdf(reals y | reals nu)
The log of the Chi-square cumulative distribution function of y given degrees of freedom nu

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Inverse chi-square distribution

Probability density function

If νR+, then for yR+, InvChiSquare(y|ν)=2ν/2Γ(ν/2)yν/21exp(121y).

Distribution statement

y ~ inv_chi_square(nu)

Increment target log probability density with inv_chi_square_lupdf(y | nu).

Available since 2.0

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

Available since 2.12

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

Available since 2.25

real inv_chi_square_cdf(reals y | reals nu)
The inverse Chi-squared cumulative distribution function of y given degrees of freedom nu

Available since 2.0

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Scaled inverse chi-square distribution

Probability density function

If νR+ and σR+, then for yR+, ScaledInvChiSquare(y|ν,σ)=(ν/2)ν/2Γ(ν/2)σνy(ν/2+1)exp(12νσ21y).

Distribution statement

y ~ scaled_inv_chi_square(nu, sigma)

Increment target log probability density with scaled_inv_chi_square_lupdf(y | nu, sigma).

Available since 2.0

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

Available since 2.12

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

Available since 2.25

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

Available since 2.0

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Exponential distribution

Probability density function

If βR+, then for yR+, Exponential(y|β)=βexp(βy).

Distribution statement

y ~ exponential(beta)

Increment target log probability density with exponential_lupdf(y | beta).

Available since 2.0

Stan functions

real exponential_lpdf(reals y | reals beta)
The log of the exponential density of y given inverse scale beta

Available since 2.12

real exponential_lupdf(reals y | reals beta)
The log of the exponential density of y given inverse scale beta dropping constant additive terms

Available since 2.25

real exponential_cdf(reals y | reals beta)
The exponential cumulative distribution function of y given inverse scale beta

Available since 2.0

real exponential_lcdf(reals y | reals beta)
The log of the exponential cumulative distribution function of y given inverse scale beta

Available since 2.12

real exponential_lccdf(reals y | reals beta)
The log of the exponential complementary cumulative distribution function of y given inverse scale beta

Available since 2.12

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.

Available since 2.18

Gamma distribution

Probability density function

If αR+ and βR+, then for yR+, Gamma(y|α,β)=βαΓ(α)yα1exp(βy).

Distribution statement

y ~ gamma(alpha, beta)

Increment target log probability density with gamma_lupdf(y | alpha, beta).

Available since 2.0

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

Available since 2.12

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

Available since 2.25

real gamma_cdf(reals y | reals alpha, reals beta)
The cumulative gamma distribution function of y given shape alpha and inverse scale beta

Available since 2.0

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Inverse gamma Distribution

Probability density function

If αR+ and βR+, then for yR+, InvGamma(y|α,β)=βαΓ(α) y(α+1)exp(β1y).

Distribution statement

y ~ inv_gamma(alpha, beta)

Increment target log probability density with inv_gamma_lupdf(y | alpha, beta).

Available since 2.0

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

Available since 2.12

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

Available since 2.25

real inv_gamma_cdf(reals y | reals alpha, reals beta)
The inverse gamma cumulative distribution function of y given shape alpha and scale beta

Available since 2.0

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Weibull distribution

Probability density function

If αR+ and σR+, then for y[0,), Weibull(y|α,σ)=ασ(yσ)α1exp((yσ)α).

Note that if YWeibull(α,σ), then Y1Frechet(α,σ1).

Distribution statement

y ~ weibull(alpha, sigma)

Increment target log probability density with weibull_lupdf(y | alpha, sigma).

Available since 2.0

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

Available since 2.12

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

Available since 2.25

real weibull_cdf(reals y | reals alpha, reals sigma)
The Weibull cumulative distribution function of y given shape alpha and scale sigma

Available since 2.0

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Frechet distribution

Probability density function

If αR+ and σR+, then for yR+, Frechet(y|α,σ)=ασ(yσ)α1exp((yσ)α).

Note that if YFrechet(α,σ), then Y1Weibull(α,σ1).

Distribution statement

y ~ frechet(alpha, sigma)

Increment target log probability density with frechet_lupdf(y | alpha, sigma).

Available since 2.5

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

Available since 2.12

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

Available since 2.25

real frechet_cdf(reals y | reals alpha, reals sigma)
The Frechet cumulative distribution function of y given shape alpha and scale sigma

Available since 2.5

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

Available since 2.12

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

Available since 2.12

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.

Available since 2.18

Rayleigh distribution

Probability density function

If σR+, then for y[0,), Rayleigh(y|σ)=yσ2exp(y2/2σ2).

Distribution statement

y ~ rayleigh(sigma)

Increment target log probability density with rayleigh_lupdf(y | sigma).

Available since 2.0

Stan functions

real rayleigh_lpdf(reals y | reals sigma)
The log of the Rayleigh density of y given scale sigma

Available since 2.12

real rayleigh_lupdf(reals y | reals sigma)
The log of the Rayleigh density of y given scale sigma dropping constant additive terms

Available since 2.25

real rayleigh_cdf(real y | real sigma)
The Rayleigh cumulative distribution of y given scale sigma

Available since 2.0

real rayleigh_lcdf(real y | real sigma)
The log of the Rayleigh cumulative distribution of y given scale sigma

Available since 2.12

real rayleigh_lccdf(real y | real sigma)
The log of the Rayleigh complementary cumulative distribution of y given scale sigma

Available since 2.12

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.

Available since 2.18

Log-logistic distribution

Probability density function

If α,βR+, then for yR+, Log-Logistic(y|α,β)= (βα)(yα)β1 (1+(yα)β)2.

Distribution statement

y ~ loglogistic(alpha, beta)

Increment target log probability density with unnormalized version of loglogistic_lpdf(y | alpha, beta)

Available since 2.29

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

Available since 2.29

real loglogistic_cdf(reals y | reals alpha, reals beta)
The log-logistic cumulative distribution function of y given scale alpha and shape beta

Available since 2.29

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.

Available since 2.29
Back to top