When samples of $n$ observations are taken from the normal distribution with mean $\mu$ and variance $\sigma^2$, then Cochran's theorem states that $\frac{n S^2}{\sigma^2} \backsim \chi^2_{n-1}$. Clearly, this distribution is a function of the population variance.

I am having difficulty working out exactly how I can express the distribution of $S^2$ using Mathematica's ChiSquareDistribution[ν], which has a single parameter $\nu$ capturing degrees of freedom.

To express the distribution of $S^2$ using Mathematica's ChiSquareDistribution[ν], do I simply multiply ChiSquareDistribution[ν] by $\sigma^2$ and divide by $n$?

Perhaps someone can confirm/dis-confirm my approach, ideally by stating the exact expression of how to solve the stated problem?


2 Answers 2


To obtain the distribution with Mathematica functions one sees that $S^2$ is a multiple of a $\chi^2$ random variable with $n-1$ degrees of freedom: $S^2=(\sigma^2/n)\chi^2_{n-1}$.

distS2 = TransformedDistribution[σ^2 x2/n, 
  x2 \[Distributed] ChiSquareDistribution[n - 1]]
(* GammaDistribution[1/2 (-1+n),(2 σ^2)/n] *)

The expectation of $S^2$ is found with

Expectation[s2, s2 \[Distributed] distS2]
(* ((-1+n) σ^2)/n *)

If I am not mistaken, the probability distribution pdf and the cummulative probability distribution cdf of $S^2$ should be given by

pdf = n/σ^2 PDF[ChiSquareDistribution[n - 1]][t n/σ^2];
cdf = CDF[ChiSquareDistribution[n - 1]][t n/σ^2];

Some wuick consistency tests for the scalings:

Integrate[pdf, {t, 0, ∞}, Assumptions -> {σ > 0, n >= 2}] == 1
Limit[cdf, t -> ∞, Assumptions -> {σ > 0, n >= 2}] == 1
D[cdf, t] == pdf // Simplify




  • $\begingroup$ I think you meant to have $n/\sigma^2$ rather than $\sigma^2/n$: pdf = (n/σ^2) PDF[ChiSquareDistribution[n - 1]][t n/σ^2];. $\endgroup$
    – JimB
    Dec 18, 2018 at 4:23
  • $\begingroup$ @JimB Thanks for the hint! I am not able to figure it out (transformation formula is soo puzzling, you know), so I am relying on your expertise here. =D $\endgroup$ Dec 18, 2018 at 8:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.