chi2distribution: Chi-Square Distribution

density_chi2R Documentation

Chi-Square Distribution

Description

Density, cumulative distribution function and random generation for chi-square distribution.

Usage

density_chi2(df, x)

cdf_chi2(df, x)

random_chi2(df, n)

Arguments

df

degrees of freedom.

x

vector of quantiles.

n

number of observations.

Value

numeric vector

Functions density_XXX and cdf_XXX return numeric vectors of same length as x. Function random_XXX returns a numeric vector of length n.

Examples


# Probability density function for a Chi-Square distribution with 3 degrees of freedom.
z <-density_chi2(df = 3,.01 * seq(-100, 100, 1))

# Computing the probability that the random variable X following a Chi-Square distribution
# with df degrees of freedom is lower than x
cdf_chi2(df = 3, x= 1:10)

# Generating a random vector with each component drawn from a Chi-square distribution
# with df degrees of freedom
z <- random_chi2(df = 3, n = 10)


rjd3toolkit documentation built on Sept. 21, 2026, 5:06 p.m.