I have $X_1,...,X_n$, i.i.d. $N(\mu,\sigma^2)$ and I would like to calculate $\text{var}[(X_i−\mu)^2]$.
I know that the solution is $2\sigma^4$.
However, I can't derive it. Any suggestions?
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.
Sign up to join this communityI have $X_1,...,X_n$, i.i.d. $N(\mu,\sigma^2)$ and I would like to calculate $\text{var}[(X_i−\mu)^2]$.
I know that the solution is $2\sigma^4$.
However, I can't derive it. Any suggestions?
Quite simple, just see: $$V\left[(X - \mu)^2\right] = \sigma^4 V\left[\left(\frac{X - \mu}{\sigma}\right)^2\right]$$ $$=\sigma^4 V(Z^2)$$ where, $ Z \sim N(0, 1)$
So, $Z^2 \sim \chi^2_1$, $V(Z^2) = 2$ (Variance of chi-square is 2$v$, where $v$ is degree of freedom. ).
It complete our proof, $$V\left[(X - \mu)^2\right] = 2 \sigma^4$$
The question is how to prove $\operatorname{var}\left( \left( \dfrac{X-\mu} \sigma \right)^2 \right) = 2$ when $X\sim\operatorname N(\mu,\sigma^2).$
We have $Z=\dfrac{X-\mu}\sigma \sim \operatorname N(0,1),$ so the problem is how to prove $\operatorname{var}(Z^2) = 2$ when $Z\sim\operatorname N(0,1).$
First note that $$ \operatorname E(Z^2) = \operatorname E((Z-0)^2) = \operatorname E((Z-\operatorname E(Z))^2) = \operatorname{var}(Z) = 1. $$ Then recall that $$ \operatorname{var}(Z^2) = \operatorname E \Big( \big( Z^2\big)^2 \Big) - \left( \operatorname E(Z^2) \right)^2. $$ Therefore $$ \operatorname{var}(Z^2) = \operatorname E\left( Z^4\right) - 1. $$ The problem then is to show that $\operatorname E(Z^4) = 3.$
\begin{align} \operatorname E(Z^4) = {} & \int_{-\infty}^{+\infty} z^4 \varphi(z)\, dz \\ & \text{where $\varphi$ is the standard normal density} \\[10pt] = {} & 2\int_0^{+\infty} z^4\varphi(z)\,dz \\[10pt] = {} & 2\int_0^{+\infty} z^4 \cdot \frac 1 {\sqrt{2\pi}} e^{-z^2/2} \, dz \\[10pt] = {} & \sqrt{\frac 2 \pi} \int_0^{+\infty} z^3 e^{-z^2/2} (z\,dz) \\[10pt] = {} & \sqrt{\frac 2 \pi} \int_0^{+\infty} (\sqrt{2u\,\,}\,)^3 e^{-u} \, du \\[10pt] = {} & \frac 4 {\sqrt\pi} \int_0^{+\infty} u^{3/2} e^{-u}\, du \\[10pt] = {} & \frac 4 {\sqrt\pi} \Gamma\left( \frac 5 2\right) = \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot \frac 1 2 \cdot \Gamma\left( \frac 1 2 \right) \tag 1 \\[10pt] = {} & \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot\frac 1 2 \cdot \sqrt\pi \tag 2 \\[10pt] = {} & 3. \end{align} The work done on the line labeled $(1)$ can be justified by integrating by parts. What is done on line $(2)$ can be justified by an argument involving polar coordinates. Maybe I'll wait to see if there's popular demand before addressing those.
Guide:
Some possible ingredients to solve the problem.
\begin{align} \operatorname{Var}(Z) &= \operatorname E(Z^2)-E(Z)^2\\ \operatorname E((X_i-\mu)^p) &= \begin{cases} 0 & ,p\text{ is odd} \\ \sigma^p(p-1)!! & ,p\text{ is even}\end{cases} \end{align}
where $n!!$ denotes the double factorial, that is, the product of all numbers $n$ to $1$ that have the same parity as $n$. The moment formula is obtained from the wikipedia page.