Suppose X_1, ..., X_n is a random sample from a normal distribution with parameter μ and σ^2 . If S^2=Σ(X_i - Xbar)^2 /n , where Xbar is the sample mean, determine the distribution of nS^2 /σ^2 .



QUESTION: 

Suppose $X_{1},... ,X_{n}$ is a random sample from a normal distribution with parameter $\mu$ and $\sigma^{2}$. If $S^{2}=\frac{\sum(X_{i}-\bar{X})^{2}}{n}$ , where $\bar{X}$ is the sample  mean, determine the distribution of $\frac{nS^{2}}{\sigma^{2}}$.

ANSWER:

$X_{1}, ...,X_{n}\sim N(\mu,\sigma^{2})$ $\bar{X}\sim N(\mu, \frac{\sigma^{2}}{n})$ $Z_{i}=\frac{x_{i}-\mu}{\sigma}\sim N(0,1), \hspace{1cm} W_{i}=(Z_{i})^{2}=(\frac{x_{i}-\mu}{\sigma})^{2}\sim \chi ^{2}_{(1)}$ $V=\sum_{i=1}^{n}W_{i}\sim \chi^{2}_{(n)}$ $Y=\frac{\bar{x}-\mu}{\sigma/\sqrt{n}}\sim N(0,1), \hspace{1cm} Y^{2}=\frac{n(\bar{x}-\mu)^{2}}{\sigma^{2}}\sim \chi^{2}_{(1)}$ $\begin{aligned}\sum_{i=1}^{n}(x_{i-\mu})^{2}&=\sum_{i=1}^{n}[(x_{i}-\bar{x})+(\bar{x}-\mu)]^{2}\\&=\sum_{i=1}^{n}[(x_{i}-\bar{x})^{2}+(\bar{x}-\mu)^{2}+2(x_{i}-\bar{x})(\bar{x}-\mu)]\\&=\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}+\sum_{i=1}^{n}(\bar{x}-\mu)^{2}+2\sum_{i=1}^{n}(x_{i}-\bar{x})(\bar{x}-\mu)\end{aligned}$

Where $\sum_{i=1}^{n}(x_{i}-\bar{x})=0$ then

$\sum_{i=1}^{n}(x_{i-\mu})^{2}=\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}+n(\bar{x}-\mu)^{2}$

To obtain a random variable with a normal distribution and chi-square, the equation is multiplied by $\frac{1}{\sigma^{2}}$

$\frac{\sum_{i=1}^{n}(x_{i-\mu})^{2}}{\sigma^{2}}=\frac{\sum_{i=1}^{n}(x_{i}-\bar{x})^{2}}{\sigma^{2}}+\frac{n(\bar{x}-\mu)^{2}}{\sigma^{2}}$

$V=\sum_{i=1}^{n}W_{i}\sim \chi^{2}_{(n)} \rightarrow M_{V}(t)=(1-2t)^{-\frac{n}{2}}$

$Y^{2}=\frac{n(\bar{x}-\mu)^{2}}{\sigma^{2}}\sim \chi^{2}_{(1)} \rightarrow M_{Y^{2}}(t)=(1-2t)^{-\frac{1}{2}}$

Based on the definition of the MGF equation, then:

$\begin{aligned}M_{V}(t)&=E(e^{tV})\\&=E(e^{t(\sum_{i=1}^{n}\frac{(x_{i-\mu})^{2}}{\sigma^{2}}+Y^{2})})\\&=M_{\sum_{i=1}^{n}(\frac{x_{i-\mu}}{\sigma})^{2}}(t). M_{Y^{2}}(t)\\(1-2t)^{-\frac{n}{2}}&=M_{\sum_{i=1}^{n}(\frac{x_{i-\mu}}{\sigma})^{2}}(t).(1-2t)^{-\frac{1}{2}}\\M_{\sum_{i=1}^{n}(\frac{x_{i-\mu}}{\sigma})^{2}}(t)&=\frac{(1-2t)^{-\frac{n}{2}}}{(1-2t)^{-\frac{1}{2}}}\\&=(1-2t)^{-\frac{n}{2}+\frac{1}{2}}\\&=(1-2t)^{-\frac{(n-1)}{2}}\\\end{aligned}$

so   $M_{\sum_{i=1}^{n}(\frac{x_{i-\mu}}{\sigma})^{2}}(t)\sim \chi^{2}_{(n-1)}$

To get the distribution of $\frac {nS^{2}}{\sigma^{2}}$ then it needs to be multiplied by $\frac{n}{n}$ :

$\begin{aligned}\sum_{i=1}^{n}(\frac{x_{i-\mu}}{\sigma})^{2} . \frac{n}{n}&=\frac{n\sum_{i=1}^{n}(\frac{x_{i-\mu}}{\sigma})^{2}}{n}\\&=\frac{n\sum_{i=1}^{n}\frac{(x_{i}-\bar{x})^{2}}{\sigma^{2}}}{n}\\&=n\sum_{i=1}^{n}\frac{\frac{(x_{i}-\bar{x})^{2}}{n}}{\sigma^{2}}\\&=\frac{nS^{2}}{\sigma^{2}}\end{aligned}$

Based on these results, it can be concluded that $\frac{nS^{2}}{\sigma^{2}}$has a chi-square distribution with degrees of freedom $(n-1)$ or  $\frac{nS^{2}}{\sigma^{2}}\sim \chi ^{2}_{(n-1)}$.