ChiSquare {distributions3} | R Documentation |
Create a Chi-Square distribution
Description
Chi-square distributions show up often in frequentist settings as the sampling distribution of test statistics, especially in maximum likelihood estimation settings.
Usage
ChiSquare(df)
Arguments
df |
Degrees of freedom. Must be positive. |
Details
We recommend reading this documentation on https://alexpghayes.github.io/distributions3/, where the math will render with additional detail and much greater clarity.
In the following, let be a
random variable with
df
= .
Support: , the set of positive real numbers
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 also stands
for the c.d.f. of a standard normal evaluated at
. Z-tables
list the value of
for various
.
Moment generating function (m.g.f):
Value
A ChiSquare
object.
Transformations
A squared standard Normal()
distribution is equivalent to a
distribution with one degree of freedom. The
distribution is a special case of the
Gamma()
distribution with shape (TODO: check this) parameter equal
to a half. Sums of distributions
are also distributed as
distributions, where the
degrees of freedom of the contributing distributions get summed.
The ratio of two
distributions is a
FisherF()
distribution. The ratio of a Normal()
and the square root
of a scaled ChiSquare()
is a StudentsT()
distribution.
See Also
Other continuous distributions:
Beta()
,
Cauchy()
,
Erlang()
,
Exponential()
,
FisherF()
,
Frechet()
,
GEV()
,
GP()
,
Gamma()
,
Gumbel()
,
LogNormal()
,
Logistic()
,
Normal()
,
RevWeibull()
,
StudentsT()
,
Tukey()
,
Uniform()
,
Weibull()
Examples
set.seed(27)
X <- ChiSquare(5)
X
mean(X)
variance(X)
skewness(X)
kurtosis(X)
random(X, 10)
pdf(X, 2)
log_pdf(X, 2)
cdf(X, 4)
quantile(X, 0.7)
cdf(X, quantile(X, 0.7))
quantile(X, cdf(X, 7))