# sample variance divided by variance is Chi Square [duplicate]

To estimate the sample variance, the following relation is often used:

$$\frac{(n-1)s^2}{\sigma^2} \sim \chi^2(n-1)$$

With $$(n-1)$$ being the degrees of freedom.

Could someone provide me a formal proof and some intuition for this relation?

• I think you mean $\large{\chi^2_{n-1}}$, with $n-1$ as a subscript. Commented Mar 20, 2021 at 16:30
• Also I think $\sigma \to \sigma^2$. I believe this will help: stats.stackexchange.com/questions/100861/… Commented Mar 20, 2021 at 16:40
• If $\mu$ is known, not estimated by $\bar X,$ then $\frac{nV}{\sigma^2} = \sim\mathsf{Chisq}(n),$ where $V = \frac{1}{n}\sum_{i=1}^n (X_i - \mu)^2.$ This follows directly from $\sum_{i=1}^n Z_i^2 \sim \mathsf{Chisq}(n),$ for $Z_i$ iid standard normals. For your expression, one says informally that a 'degree of freedom is lost' in the estimation of $\mu$ by $\bar X.$ // One formal proof uses an orthogonal transformation of a multivariate normal, so that one marginal 'respresents' $\bar X$ and the remaining $n-1$ represent $S^2.$ Commented Mar 21, 2021 at 2:20

Simulation in R: Population mean estimated by sample mean.

set.seed(2021)
n = 5;  mu = 100;  sg = 15
q4 = replicate(n^5, 4*var(rnorm(n,mu,sg))/sg^2)
mean(q4)
[1] 4.000032  # aprx mean of CHISQ(4) = 4.


In the figure below the density function of $$\mathsf{Chisq}(\nu=4)$$ fits the simulated values, while the density function of $$\mathsf{Chisq}(\nu=5)$$ does not.

hdr = "Mean estimated: CHISQ(4)"
hist(q4, prob=T, br=20, ylim=c(0,.25), col="skyblue2", main=hdr)
curve(dchisq(x,5), add=T, lwd=2, col="red", lty="dotted")


Population mean known:

set.seed(320)
n = 5;  mu = 100;  sg = 15
q5 = replicate(n^5, sum((rnorm(n,mu,sg)-mu)^2)/sg^2)
mean(q5)
[1] 5.109602  # aprx mean of CHISQ(5) = 5


hdr = "Mean known: CHISQ(5)"
hist(q5, prob=T, br=20, ylim=c(0,.20), col="skyblue2", main=hdr)
curve(dchisq(x,5), add=T, lwd=2, col="red", lty="dotted")