# Calculating the expected value and variance of sum of iid normally distributed variables and sample mean

Let $X_1, X_2, ..., X_n$ be an iid sample from $N(\mu, \theta)$, where $\mu$ is unknown. I'm trying to find the expected value and variance of the random variable $Y = \frac{1}{n} \sum_{i=1}^n (X_i - \overline{X})^2$.

My intuition is to make some transformation of $Y$ into a chi-squared variable, but I'm stuck as to where to start. Thanks in advance!

• Note that $E[\sum_{i=1}^k Y_i]=\sum_{i=1}^k E[Y_i]$ for any random variables $Y_i$ that have finite expectations. It would also help to define $\overline{X}$. – Michael Apr 17 '18 at 19:08
• I'm intending $\overline{X} = \frac{1}{n} \sum_{i=1}^n X_i$ to be the sample mean. So it seems like I need to calculate $E[(X_i - \overline{X})^2]$. Could I say that $E[(X_i - \overline{X})^2] = Var(X_i - \overline{X}) + [E(X_i - \overline{X})]^2$? – Tina Doe Apr 17 '18 at 19:16
• Yes, you can use $Var(H)=E[H^2]-E[H]^2$. In your case you should first calculate $E[X_i-\overline{X}]$ and then $Var(X_i-\overline{X})$ by usign $\overline{X}=\frac{1}{n}\sum_{j=1}^n X_i$ and formulas about variances of linear combinations of independent variables. – Michael Apr 17 '18 at 19:20

You may have to use the Fisher Theorem

Theorem (Fisher): If $(X_1,X_2,...,X_n)$ is a simple random sample of a distribution $N(\mu,\sigma)$, then $\bar X$ and $s^2$ are random independent variables, and the distribution of $\bar X$ is $N(\mu,\sigma/ \sqrt{n})$ while $ns^2/\sigma^2$ has distribution $\chi_{n-1}^2$

Knowing this, one can make the following manipulation:

$$2(n-1)=V\bigg(\frac{ns^2}{\sigma^2}\bigg)=\frac{n^2}{\sigma^4}V(s^2)$$

So that implies

$$V(s^2)=\frac{2(n-1)\sigma^4}{n^2}$$

Where in the first equality we applied Fisher's theorem directly (noting that a $\chi_{n-1}^2$ is a $\gamma\big(\frac{n-1}{2},\frac{1}{2}\big)$, its variance will be the first term divided by the second squared, that is, $2(n-1)$), and in the second we used the fact that $V(aX)=a^2V(X)$, where $a$ is a real number and $X$ is a random variable

Note: In general, the expression of the variance of the sample variance of a given distribution $X$ is

$$V(s^2)=\frac{(n-1)^2}{n^3}\mu_4+\frac{(n-1)(n-3)}{n^3}\sigma^4$$

Where $\mu_4=E[(X-\mu)^4]$ and $\sigma^4=E[(X-\mu)^2]^2$

Don't see how "transforming $Y$ into a chi-squared variable" would help.

Just expand the square and simplify to get

\begin{align} E(Y)=E\left(\frac{1}{n}\sum (X_i-\bar{X})^2\right)\\ =E\left(\frac{1}{n}\sum X_i^2-\bar{X}^2\right)\\ =\frac{1}{n}\sum E(X_i^2)-E(\bar{X}^2) \end{align}

All you have to do now is to apply the standard results $\mathrm{Var}(X_i)=\theta$, $E(X_i)=\mu$,

$\mathrm{Var}(\bar{X})=\frac{\theta}{n}$ and $E(\bar{X})=\mu$ to get the expected value of $Y$.

Remember that you have an i.i.d sample and do the same to calculate $\mathrm{Var}(Y)$.