stable
dist_chisq(df, ncp = 0)
degrees of freedom (non-negative, but can be non-integer).
non-centrality parameter (non-negative).
Chi-square distributions show up often in frequentist settings as the sampling distribution of test statistics, especially in maximum likelihood estimation settings.
We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.
In the following, let df
=
Support:
Mean:
Variance:
Probability density function (p.d.f):
Cumulative distribution function (c.d.f):
The cumulative distribution function has the form
but this integral does not have a closed form solution and must be
approximated numerically. The c.d.f. of a standard normal is sometimes
called the "error function". The notation
Moment generating function (m.g.f):
# NOT RUN {
dist <- dist_chisq(df = c(1,2,3,4,6,9))
dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)
generate(dist, 10)
density(dist, 2)
density(dist, 2, log = TRUE)
cdf(dist, 4)
quantile(dist, 0.7)
# }
Run the code above in your browser using DataLab