ChiSquareDistribution
✖
ChiSquareDistribution
Details

- The probability density for value
in a
distribution is proportional to
for
, and is zero for
. »
- For integer ν, the
distribution with ν degrees of freedom gives the distribution of sums of squares of ν values independently sampled from a normal distribution.
- ChiSquareDistribution allows ν to be any positive real number.
- ChiSquareDistribution allows ν to be a dimensionless quantity. »
- ChiSquareDistribution can be used with such functions as Mean, CDF, and RandomVariate. »
Background & Context
- ChiSquareDistribution[ν] represents a statistical distribution parametrized by a positive value ν indicating the degrees of freedom of the distribution. ν determines the general shape of the probability density function (PDF) of a chi-square distribution, and, depending on the values of ν, the PDF may be either monotonic decreasing or may have a single "peak" (i.e. a global maximum) with a potential singularity approaching the lower boundary of its domain.
- ChiSquareDistribution is the distribution followed by the square of a chi-distributed random variable. In other words, if
is a random variable and
(where
denotes "is distributed as"), then
. The sum
of a collection
,
, …,
of identically normally distributed independent random variables is also chi-square distributed. The chi-square distribution can be used to quantify the goodness of fit between a theoretical or empirical model and a collection of samples. Specific applications include magnetic resonance imaging and the analysis of possible associations between disease exposure and transmission.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a chi-square distribution. Distributed[x,ChiSquareDistribution[ν]], written more concisely as xChiSquareDistribution[ν], can be used to assert that a random variable x is distributed according to a chi-square distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
- The probability density and cumulative distribution functions for chi-square distributions may be given using PDF[ChiSquareDistribution[ν],x] and CDF[ChiSquareDistribution[ν],x]. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively.
- DistributionFitTest can be used to test if a given dataset is consistent with a chi-square distribution, EstimatedDistribution to estimate a chi-square parametric distribution from given data, and FindDistributionParameters to fit data to a chi-square distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic chi-square distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic chi-square distribution.
- TransformedDistribution can be used to represent a transformed chi-square distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a chi-square distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving chi-square distributions.
- ChiSquareDistribution is closely related to a number of other distributions. For example, several distributions, including GammaDistribution, ExponentialDistribution, InverseChiSquareDistribution, UniformDistribution, and LaplaceDistribution, can be obtained by transformations of ChiSquareDistribution, while NormalDistribution and FRatioDistribution are limiting values for transformed versions of ChiSquareDistribution. Moreover, ChiSquareDistribution can be viewed as a special case of a number of other more general distributions, including RayleighDistribution, MaxwellDistribution, PearsonDistribution, and ParetoDistribution. ChiSquareDistribution is also closely related to BetaDistribution, StudentTDistribution, UniformDistribution, and NoncentralChiSquareDistribution.
Examples
open allclose allBasic Examples (4)Summary of the most common use cases

https://wolfram.com/xid/0cprrvhgf9qnw6-yvnrh3


https://wolfram.com/xid/0cprrvhgf9qnw6-36ah0k

Cumulative distribution function:

https://wolfram.com/xid/0cprrvhgf9qnw6-l7872c


https://wolfram.com/xid/0cprrvhgf9qnw6-bsauaj


https://wolfram.com/xid/0cprrvhgf9qnw6-r1b


https://wolfram.com/xid/0cprrvhgf9qnw6-fkq


https://wolfram.com/xid/0cprrvhgf9qnw6-43qm45

Scope (8)Survey of the scope of standard use cases
Generate a sample of pseudorandom numbers from a distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-qhtk5j
Compare its histogram to the PDF:

https://wolfram.com/xid/0cprrvhgf9qnw6-03mwaz

Distribution parameters estimation:

https://wolfram.com/xid/0cprrvhgf9qnw6-45b7g2
Estimate the distribution parameters from sample data:

https://wolfram.com/xid/0cprrvhgf9qnw6-epi747

Compare density histogram of the sample with the PDF of the estimated distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-f8ui5o


https://wolfram.com/xid/0cprrvhgf9qnw6-nr2384


https://wolfram.com/xid/0cprrvhgf9qnw6-b8g

For a large number of degrees of freedom, the distribution becomes symmetric:

https://wolfram.com/xid/0cprrvhgf9qnw6-k9jgkp


https://wolfram.com/xid/0cprrvhgf9qnw6-vpjjid


https://wolfram.com/xid/0cprrvhgf9qnw6-yq

The limiting value is the kurtosis of NormalDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-knketa

Different moments with closed forms as functions of parameters:

https://wolfram.com/xid/0cprrvhgf9qnw6-js043h

https://wolfram.com/xid/0cprrvhgf9qnw6-rx074o

Closed form for symbolic order:

https://wolfram.com/xid/0cprrvhgf9qnw6-losg5a


https://wolfram.com/xid/0cprrvhgf9qnw6-pknsqa

Closed form for symbolic order:

https://wolfram.com/xid/0cprrvhgf9qnw6-xtwz0f


https://wolfram.com/xid/0cprrvhgf9qnw6-zg9ct4


https://wolfram.com/xid/0cprrvhgf9qnw6-9gzmth

Cumulant has closed form:

https://wolfram.com/xid/0cprrvhgf9qnw6-d72oj


https://wolfram.com/xid/0cprrvhgf9qnw6-wcebyc


https://wolfram.com/xid/0cprrvhgf9qnw6-sayngx


https://wolfram.com/xid/0cprrvhgf9qnw6-od81p2


https://wolfram.com/xid/0cprrvhgf9qnw6-sdltp

Use dimensionless Quantity to specify the degree of freedom parameter ν:

https://wolfram.com/xid/0cprrvhgf9qnw6-bpk1rz

Applications (2)Sample problems that can be solved with this function
ChiSquareDistribution is used in exact (small) sampling theory. Define statistics:

https://wolfram.com/xid/0cprrvhgf9qnw6-66shng
If data comes from a NormalDistribution, then statistics follow ChiSquareDistribution, even for data that is a sample of small size (less than 30):

https://wolfram.com/xid/0cprrvhgf9qnw6-4k67k2

The weight in grams of a particular boxed cereal product is known to follow a normal distribution. A quality assurance team samples 15 boxes at random and records their weights. Test the hypothesis that the standard deviation of the product weight is less than 36:

https://wolfram.com/xid/0cprrvhgf9qnw6-36ecab

https://wolfram.com/xid/0cprrvhgf9qnw6-3cklsq

Under the null hypothesis of , the following statistic follows ChiSquareDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-84wu7b

The null hypothesis cannot be rejected at the 5% level:

https://wolfram.com/xid/0cprrvhgf9qnw6-odxdd5

Assuming that the standard deviation of the product weight equals 32, compute the probability of rejecting the null hypothesis, also known as the power of the test, at the 5% level as a function of sample size:

https://wolfram.com/xid/0cprrvhgf9qnw6-1nefaw

https://wolfram.com/xid/0cprrvhgf9qnw6-wj1jf1

Find the sample size required for the power of the test to be at least 80%:

https://wolfram.com/xid/0cprrvhgf9qnw6-0slqrp

Properties & Relations (23)Properties of the function, and connections to other functions
ChiSquareDistribution[ν] converges to a normal distribution as ν->∞:

https://wolfram.com/xid/0cprrvhgf9qnw6-2saka


https://wolfram.com/xid/0cprrvhgf9qnw6-h0zjmr

Sum of -distributed variables follows
distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-qmgxlt

Relationships to other distributions:

NoncentralChiSquareDistribution simplifies to distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-q8i


https://wolfram.com/xid/0cprrvhgf9qnw6-cbn


https://wolfram.com/xid/0cprrvhgf9qnw6-3zysj8

distribution is a limiting case of FRatioDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-shcpsv


https://wolfram.com/xid/0cprrvhgf9qnw6-3yti9r


https://wolfram.com/xid/0cprrvhgf9qnw6-bob5cm

The ratio of two -distributed variables follows FRatioDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-slfhyz

Sum of squares of variables from NormalDistribution follows
distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-0xs75z

distribution is a special case of GammaDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-dhbbvb


https://wolfram.com/xid/0cprrvhgf9qnw6-psnl2


https://wolfram.com/xid/0cprrvhgf9qnw6-jepik9

Scaled distribution follows GammaDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-mxcd7c

The square root of a variable follows the ChiDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-xczwap

Square of RayleighDistribution with is a special case of
distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-qydiox


https://wolfram.com/xid/0cprrvhgf9qnw6-mznr2z


https://wolfram.com/xid/0cprrvhgf9qnw6-g3vfzv


https://wolfram.com/xid/0cprrvhgf9qnw6-vp5l3s

Square of MaxwellDistribution with is a special case of
distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-mp6ega

https://wolfram.com/xid/0cprrvhgf9qnw6-mwepxc


https://wolfram.com/xid/0cprrvhgf9qnw6-nryk8g


https://wolfram.com/xid/0cprrvhgf9qnw6-mrvyun

distribution and InverseChiSquareDistribution have an inverse relationship:

https://wolfram.com/xid/0cprrvhgf9qnw6-fdwlka

distribution is a special case of type 3 PearsonDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-2a1tgg


https://wolfram.com/xid/0cprrvhgf9qnw6-j3sph5


https://wolfram.com/xid/0cprrvhgf9qnw6-1ijdyq

A transformation of distribution yields BetaDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-zinb8k

is a transformation of UniformDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-v5jymv

https://wolfram.com/xid/0cprrvhgf9qnw6-ns8mp1


https://wolfram.com/xid/0cprrvhgf9qnw6-z1o4v3


https://wolfram.com/xid/0cprrvhgf9qnw6-8m5lar

distribution is a transformation of LaplaceDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-8bqzu7

https://wolfram.com/xid/0cprrvhgf9qnw6-de3grq


https://wolfram.com/xid/0cprrvhgf9qnw6-nipdgw


https://wolfram.com/xid/0cprrvhgf9qnw6-r3kg8n


https://wolfram.com/xid/0cprrvhgf9qnw6-240mtg

https://wolfram.com/xid/0cprrvhgf9qnw6-ps8vj6


https://wolfram.com/xid/0cprrvhgf9qnw6-qy1tdb


https://wolfram.com/xid/0cprrvhgf9qnw6-g85n64

distribution is a transformation of ParetoDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-fyfxg2

https://wolfram.com/xid/0cprrvhgf9qnw6-lvdf8h

distribution is a transformation of ParetoDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-4ww94q

https://wolfram.com/xid/0cprrvhgf9qnw6-sgtwqg

StudentTDistribution is a transformation of distribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-nyufvh

https://wolfram.com/xid/0cprrvhgf9qnw6-jpodex

StudentTDistribution can be obtained from ChiSquareDistribution and NormalDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-uzjzzd

https://wolfram.com/xid/0cprrvhgf9qnw6-ftmbps


https://wolfram.com/xid/0cprrvhgf9qnw6-7izxbh


https://wolfram.com/xid/0cprrvhgf9qnw6-vlmzkx

NoncentralBetaDistribution can be obtained as a transformation of ChiSquareDistribution and NoncentralChiSquareDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-ioht0x

NoncentralStudentTDistribution can be obtained from NormalDistribution and ChiSquareDistribution:

https://wolfram.com/xid/0cprrvhgf9qnw6-6ianfa

https://wolfram.com/xid/0cprrvhgf9qnw6-x9yblq

Possible Issues (2)Common pitfalls and unexpected behavior
ChiSquareDistribution is not defined when ν is not a positive real number:

https://wolfram.com/xid/0cprrvhgf9qnw6-yjw


Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

https://wolfram.com/xid/0cprrvhgf9qnw6-yol

Wolfram Research (2007), ChiSquareDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/ChiSquareDistribution.html (updated 2016).
Text
Wolfram Research (2007), ChiSquareDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/ChiSquareDistribution.html (updated 2016).
Wolfram Research (2007), ChiSquareDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/ChiSquareDistribution.html (updated 2016).
CMS
Wolfram Language. 2007. "ChiSquareDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/ChiSquareDistribution.html.
Wolfram Language. 2007. "ChiSquareDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/ChiSquareDistribution.html.
APA
Wolfram Language. (2007). ChiSquareDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChiSquareDistribution.html
Wolfram Language. (2007). ChiSquareDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChiSquareDistribution.html
BibTeX
@misc{reference.wolfram_2025_chisquaredistribution, author="Wolfram Research", title="{ChiSquareDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/ChiSquareDistribution.html}", note=[Accessed: 09-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_chisquaredistribution, organization={Wolfram Research}, title={ChiSquareDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/ChiSquareDistribution.html}, note=[Accessed: 09-July-2025
]}