Skip to contents

Functions to compute the probability density function, cumulative distribution function, and quantile function for the Chi-Squared distribution.

Usage

chi_squared_pdf(x, df)

chi_squared_lpdf(x, df)

chi_squared_cdf(x, df)

chi_squared_lcdf(x, df)

chi_squared_quantile(p, df)

Arguments

x

quantile

df

degrees of freedom (df > 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

# Chi-Squared distribution with 3 degrees of freedom
chi_squared_pdf(2, 3)
#> [1] 0.2075537
chi_squared_lpdf(2, 3)
#> [1] -1.572365
chi_squared_cdf(2, 3)
#> [1] 0.4275933
chi_squared_lcdf(2, 3)
#> [1] -0.8495828
chi_squared_quantile(0.5, 3)
#> [1] 2.365974