Learn R Programming

boostmath (version 1.0.0)

gamma_distribution: Gamma Distribution Functions

Description

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)

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.

Arguments

x

quantile

shape

shape parameter (shape > 0)

scale

scale parameter (scale > 0)

p

probability (0 <= p <= 1)

See Also

Boost Documentation for more details on the mathematical background.

Examples

Run this code
# Gamma distribution with shape = 3, scale = 4
gamma_pdf(2, 3, 4)
gamma_lpdf(2, 3, 4)
gamma_cdf(2, 3, 4)
gamma_lcdf(2, 3, 4)
gamma_quantile(0.5, 3, 4)

Run the code above in your browser using DataLab