Estimating variance given the mean Assume we have a normal distribution with known mean $\mu$. How can we estimate the variance by sampling?
The typical answer to this question is to use the unbiased sample variance estimator i.e. if the data points are indicated by $x_1, \ldots x_n$ the following:
$$\frac{(x_1-\bar{x})^2+\ldots +(x_n-\bar{x})^2}{n-1}$$
Where $\bar{x}$ is the sample mean. Now can we use the actual mean in any meaningful way to get a better estimator of the variance? The first thing that comes to mind would be to replace $\bar{x}$ by $\mu$ and divide it by $n$ instead of $n-1$ (to keep it unbiased). Is this a better estimator? why?

Let's check if $\hat\sigma^2_{you}=\dfrac{\sum_{i = 1}^n (x_i - \mu)^2}{n-1}$ is unbiased for $\sigma^2$.
$$
\mathbb E\Bigg[
\dfrac{\sum_{i = 1}^n (x_i - \mu)^2}{n-1}
\Bigg] \\
=
\dfrac{1}{n-1} \mathbb E\Bigg[
\sum_{i = 1}^n (x_i - \mu)^2
\Bigg] \\=
\dfrac{1}{n-1} \sum_{i = 1}^n\mathbb E\Bigg[
 (x_i - \mu)^2
\Bigg] \\ =
\dfrac{1}{n-1} \sum_{i = 1}^n\mathbb E\Bigg[
 x_i^2  -2\mu x_i + \mu^2
\Bigg] \\=
\dfrac{1}{n-1} \sum_{i = 1}^n\Bigg[\mathbb E\big[x_i^2\big] -2\mu\mathbb E\big[x_i\big]+\mu^2\Bigg]\\=
\dfrac{1}{n-1} \sum_{i = 1}^n\Bigg[\mathbb E\big[x_i^2\big] -2\mu^2+\mu^2\Bigg]\\=
\dfrac{1}{n-1} \sum_{i = 1}^n\Bigg[\mathbb E\big[x_i^2\big] -\mu^2\Bigg]
$$
Now, $\mathbb E\big[x_i^2\big]=\mathbb E\big[x_i\big]^2 + \mathbb Var(x_i)$, so:
$$
\dfrac{1}{n-1} \sum_{i = 1}^n\Bigg[\mathbb E\big[x_i^2\big] -\mu^2\Bigg]\\=
\dfrac{1}{n-1} \sum_{i = 1}^n\Bigg[\mathbb E\big[x_i\big]^2 + \mathbb Var(x_i) -\mu^2\Bigg] \\=
\dfrac{1}{n-1} \sum_{i = 1}^n\Bigg[\mu^2 + \mathbb Var(x_i) -\mu^2\Bigg] \\=
\dfrac{1}{n-1} \sum_{i = 1}^n\mathbb Var(x_i) \\=
 \dfrac{n}{n-1} \mathbb Var(x_i)
$$
Consequently, $\hat\sigma^2_{you}$ is biased for $\sigma^2$!
However, if you redo that calculation with a $n$ denominator, you get an unbiased estimator for $\sigma^2$.
$$\hat\sigma^2_{unbiased}=\dfrac{\sum_{i = 1}^n (x_i - \mu)^2}{n}$$
Whether or not this $n$-denominator is the best estimator is a matter of opinion, but it is unbiased. For better or for worse, most choices about what estimator to use come down to a matter of opinion.
