Skip to contents

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

Usage

beta_pdf(x, alpha, beta)

beta_lpdf(x, alpha, beta)

beta_cdf(x, alpha, beta)

beta_lcdf(x, alpha, beta)

beta_quantile(p, alpha, beta)

Arguments

x

quantile (0 <= x <= 1)

alpha

shape parameter (alpha > 0)

beta

shape parameter (beta > 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

# Beta distribution with shape parameters alpha = 2, beta = 5
beta_pdf(0.5, 2, 5)
#> [1] 0.9375
beta_lpdf(0.5, 2, 5)
#> [1] -0.06453852
beta_cdf(0.5, 2, 5)
#> [1] 0.890625
beta_lcdf(0.5, 2, 5)
#> [1] -0.1158318
beta_quantile(0.5, 2, 5)
#> [1] 0.26445