Skip to contents

Functions to compute the probability density function, cumulative distribution function, and quantile function for the Gamma distribution.

Usage

gamma_pdf(x, shape, scale)

gamma_lpdf(x, shape, scale)

gamma_cdf(x, shape, scale)

gamma_lcdf(x, shape, scale)

gamma_quantile(p, shape, scale)

Arguments

x

quantile

shape

shape parameter (shape > 0)

scale

scale parameter (scale > 0)

p

probability (0 <= p <= 1)

Value

A single numeric value with the computed probability density, log-probability density, cumulative distribution, log-cumulative distribution, or quantile depending on the function called.

See also

Boost Documentation for more details on the mathematical background.

Examples

# Gamma distribution with shape = 3, scale = 4
gamma_pdf(2, 3, 4)
#> [1] 0.01895408
gamma_lpdf(2, 3, 4)
#> [1] -3.965736
gamma_cdf(2, 3, 4)
#> [1] 0.01438768
gamma_lcdf(2, 3, 4)
#> [1] -4.241383
gamma_quantile(0.5, 3, 4)
#> [1] 10.69624