Algebra question: unbiased estimator of variance

49 Views Asked by At

I've been racking my brain over what I suspect should be a simple question. Wikipedia (https://en.wikipedia.org/wiki/Bias_of_an_estimator#Examples) offers this explanation of why the sample mean is a biased estimator of the population mean:

\begin{aligned}\operatorname {E} [S^{2}]=\operatorname {E} \left[{\frac {1}{n}}\sum _{i=1}^{n}\left(X_{i}-{\overline {X}}\right)^{2}\right]=\operatorname {E} {\bigg [}{\frac {1}{n}}\sum _{i=1}^{n}{\big (}(X_{i}-\mu )-({\overline {X}}-\mu ){\big )}^{2}{\bigg ]}=\\ =\operatorname {E} {\bigg [}{\frac {1}{n}}\sum _{i=1}^{n}(X_{i}-\mu )^{2}-2({\overline {X}}-\mu )(X_{i}-\mu )+({\overline {X}}-\mu )^{2}{\bigg ]}=\\ =\operatorname {E} {\bigg [}{\frac {1}{n}}\sum _{i=1}^{n}(X_{i}-\mu )^{2}-({\overline {X}}-\mu )^{2}{\bigg ]}=\sigma ^{2}-\operatorname {E} \left[({\overline {X}}-\mu )^{2}\right]<\sigma ^{2}.\end{aligned}

Can anyone please explain to me how we went from $${=\operatorname {E} {\bigg [}\frac {1}{n}}\sum _{i=1}^{n}(X_{i}-\mu )^{2}-2({\overline {X}}-\mu )(X_{i}-\mu )+({\overline {X}}-\mu )^{2}{\bigg ]}$$

to: $${=\operatorname {E} {\bigg [}{\frac {1}{n}}\sum _{i=1}^{n}(X_{i}-\mu )^{2}-({\overline {X}}-\mu )^{2}{\bigg ]}}$$

I don't see how $**{-2({\overline {X}}-\mu )(X_{i}-\mu )+({\overline {X}}-\mu )^{2}}**$ turned into $-({\overline {X}}-\mu )^{2}$.

Please, help. I know it's simple, but my only math is what I have left over from school. Thanks.

2

There are 2 best solutions below

1
On BEST ANSWER

$\sum_{i=1}^{n}2\left(\overline{X}-\mu\right)\left(X_{i}-\mu\right)=2\left(\overline{X}-\mu\right)\sum_{i=1}^{n}\left(X_{i}-\mu\right)=2\left(\overline{X}-\mu\right)\left[\sum_{i=1}^{n}X_{i}-n\mu\right]=2n\left(\overline{X}-\mu\right)^{2}$

and

$\sum_{i=1}^{n}\left(\overline{X}-\mu\right)^{2}=n\left(\overline{X}-\mu\right)^{2}$

Subtracting the first from the second you arrive at

$-n\left(\overline{X}-\mu\right)^{2}=\sum_{i=1}^{n}-\left(\overline{X}-\mu\right)^{2}$


edit (route with more oversight)

$\mathbb{E}S^{2}=\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}\left(X_{i}-\overline{X}\right)^{2}=\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}\left[X_{i}^{2}-2\overline{X}X_{i}+\overline{X}^{2}\right]$

First do the special case $\mu=0$ and we treat the three terms separately.

Equipped with the knowledge that $\mathbb{E}X_{i}^{2}=\sigma^{2}$ and $\sum_{i=1}^{n}X_{i}=n\overline{X}$ we find:

$\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}X_{i}^{2}=\frac{1}{n}\sum_{i=1}^{n}\mathbb{E}X_{i}^{2}=\sigma^{2}$

$\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}\left[-2\overline{X}X_{i}\right]=-2\mathbb{E}\overline{X}^{2}$

$\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}\overline{X}^{2}=\frac{1}{n}\sum_{i=1}^{n}\mathbb{E}\overline{X}^{2}=\mathbb{E}\overline{X}^{2}$

So addition of these terms leads to $\mathbb{E}S^{2}=\sigma^{2}-\mathbb{E}\overline{X}^{2}$

In the general case define $Y_{i}=X_{i}-\mu$ and realize that $\overline{Y}=\overline{X}-\mu$ so that $X_{i}-\overline{X}=Y_{i}-\overline{Y}$.

Then: $$\mathbb{E}S^{2}=\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}\left(X_{i}-\overline{X}\right)^{2}=\mathbb{E}\frac{1}{n}\sum_{i=1}^{n}\left(Y_{i}-\overline{Y}\right)^{2}=\sigma^{2}-\mathbb{E}\overline{Y}^{2}=\sigma^{2}-\mathbb{E}\left(\overline{X}-\mu\right)^{2}$$

1
On

I'll just isolate the relevant part. First, split up the sum. $$ \frac{1}{n}\sum_{i=1}^n \left( -2(\overline{X}-\mu)(X_i-\mu) + (\overline{X}-\mu)^2 \right) = \frac1n \left( -2 (\overline{X} - \mu) \sum_i(X_i - \mu) + \sum_i (\overline{X}-\mu)^2 \right) $$ Note that $\sum_i X_i = n\overline{X}$. This gives $$ \frac1n \left( -2 (\overline{X} - \mu) (n\overline{X} - n\mu) + n(\overline{X}-\mu)^2 \right) $$ which is $$ -2(\overline{X} - \mu)(\overline{X} - \mu) + (\overline{X}-\mu)^2 $$ and that equals $-(\overline{X}-\mu)^2$.