Porisma

Calculate unbiased estimates

Connect the formulas to raw, frequency and shifted data.

Why the mean and variance estimates are unbiased

For iid observations with common finite mean μ\mu and variance σ2\sigma^2, let Xˉ=1n∑i=1nXi\bar X=\frac1n\sum_{i=1}^nX_i. By linearity,

E(Xˉ)=1nE(X1+⋯+Xn)=1n[E(X1)+⋯+E(Xn)]=nμn=μ.E(\bar X)=\frac1n E(X_1+\cdots+X_n)=\frac1n[E(X_1)+\cdots+E(X_n)]=\frac{n\mu}{n}=\mu.

This expectation calculation only needs the common mean. Independence is needed when dropping covariances in the variance calculation:

Var⁡(Xˉ)=1n2Var⁡(X1+⋯+Xn)=1n2∑i=1nVar⁡(Xi)=nσ2n2=σ2n.\operatorname{Var}(\bar X)=\frac1{n^2}\operatorname{Var}(X_1+\cdots+X_n)=\frac1{n^2}\sum_{i=1}^n\operatorname{Var}(X_i)=\frac{n\sigma^2}{n^2}=\frac{\sigma^2}{n}.

The standard error is σ/n\sigma/\sqrt n. For n>1n>1 and positive variance, this variance is smaller than the individual variance; at n=1n=1 it is equal.

For dependent observations, covariance terms must be included. An exact finite-population sample without replacement may require a finite-population correction; do not silently replace that sampling design with iid draws.

For n>1n>1, define

S2=1n−1∑i(Xi−Xˉ)2=1n−1[∑iXi2−(∑iXi)2n].S^2=\frac1{n-1}\sum_i(X_i-\bar X)^2=\frac1{n-1}\left[\sum_i X_i^2-\frac{(\sum_iX_i)^2}{n}\right].

Expand the centred sum:

∑i(Xi−Xˉ)2=∑iXi2−2Xˉ∑iXi+nXˉ2=∑iXi2−nXˉ2,\sum_i(X_i-\bar X)^2=\sum_iX_i^2-2\bar X\sum_iX_i+n\bar X^2=\sum_iX_i^2-n\bar X^2,

because ∑iXi=nXˉ\sum_iX_i=n\bar X. Here Xˉ\bar X is common to every summand, but it is still a random variable; the source’s phrase “Xˉ\bar X is a constant” is only meaningful with respect to the summation index. We do not pull it out of an expectation as a deterministic quantity.

Using E(Xi2)=σ2+μ2E(X_i^2)=\sigma^2+\mu^2 and E(Xˉ2)=Var⁡(Xˉ)+[E(Xˉ)]2=σ2/n+μ2E(\bar X^2)=\operatorname{Var}(\bar X)+[E(\bar X)]^2=\sigma^2/n+\mu^2,

E(S2)=n(σ2+μ2)−n(σ2/n+μ2)n−1=(n−1)σ2n−1=σ2.E(S^2)=\frac{n(\sigma^2+\mu^2)-n(\sigma^2/n+\mu^2)}{n-1}=\frac{(n-1)\sigma^2}{n-1}=\sigma^2.

Thus the observed s2s^2 is an unbiased variance estimate. This does not say that S=S2S=\sqrt{S^2} is generally unbiased for σ\sigma.

Formula and calculator notation tables

Choose the case that matches the supplied data. Calculate the mean and variance separately, then check which denominator the calculator uses.

Given data: ∑x,∑x2\sum x,\sum x^2 and nn

  • Mean estimate: xˉ=∑x/n\bar x=\sum x/n
  • Unbiased variance estimate: s2=[∑x2−(∑x)2/n]/(n−1)s^2=[\sum x^2-(\sum x)^2/n]/(n-1)

Given data: ∑(x−a),∑(x−a)2\sum(x-a),\sum(x-a)^2 and nn

  • Mean estimate: xˉ=a+∑(x−a)/n\bar x=a+\sum(x-a)/n
  • Unbiased variance estimate: s2=[∑(x−a)2−(∑(x−a))2/n]/(n−1)s^2=[\sum(x-a)^2-(\sum(x-a))^2/n]/(n-1)

Given data: Variance computed with denominator nn

  • Mean estimate: Use the observed mean
  • Unbiased variance estimate: Multiply that variance by n/(n−1)n/(n-1)

Quantity: Population parameter

  • Mean notation: μ\mu
  • Variance notation: σ2\sigma^2

Quantity: Observed sample summaries

  • Mean notation: xˉ\bar x
  • Variance notation: Source “sample variance”: ∑(x−xˉ)2/n\sum(x-\bar x)^2/n; calculator σx2\sigma_x^2

Quantity: Unbiased population estimates

  • Mean notation: xˉ\bar x
  • Variance notation: s2=∑(x−xˉ)2/(n−1)s^2=\sum(x-\bar x)^2/(n-1); calculator Sx2S_x^2

“Sample variance” is used with different denominator conventions in different texts. This source uses the denominator-nn version in its MF27 comparison, then multiplies by n/(n−1)n/(n-1). Check the formula rather than inferring it from the name.

For nonconstant data, calculator SxS_x is larger than σx\sigma_x because its squared value has denominator n−1n-1; both are zero for constant data.

Square the stored SxS_x to obtain s2s^2 and avoid premature rounding.

Raw values go in L1; a frequency table also requires its frequencies in L2, as Examples 2 and 3 show.

Why shifting simplifies the arithmetic

The lecture contrasts ∑x=1000005\sum x=1000005 with ∑(x−10000)=5\sum(x-10000)=5 for n=100n=100. A shift changes the mean but not the centred sum of squares. First,

∑(x−a)n+a=∑x−nan+a=∑xn.\frac{\sum(x-a)}n+a=\frac{\sum x-na}n+a=\frac{\sum x}n.

Next, expand both terms:

∑(x−a)2−[∑(x−a)]2n=∑x2−2a∑x+na2−(∑x−na)2n=∑x2−2a∑x+na2−(∑x)2n+2a∑x−na2=∑x2−(∑x)2n.\begin{aligned} \sum(x-a)^2-\frac{[\sum(x-a)]^2}{n} &=\sum x^2-2a\sum x+na^2-\frac{(\sum x-na)^2}{n}\\ &=\sum x^2-2a\sum x+na^2-\frac{(\sum x)^2}{n}+2a\sum x-na^2\\ &=\sum x^2-\frac{(\sum x)^2}{n}. \end{aligned}

Dividing by n−1n-1 proves the shifted variance formula. Do not add the shift back to a variance.

Calculate, then explain what the estimate means

For ten observations, ∑(x−50)=20\sum(x-50)=20 and ∑(x−50)2=130\sum(x-50)^2=130. Find estimates of the population mean and variance. Explain which estimate needs the shift restored and why the variance estimate uses 9.

After your attempt: compare the reasoning

The mean estimate is 50+20/10=5250+20/10=52. The unbiased variance estimate is [130−202/10]/9=10[130-20^2/10]/9=10. Shifting changes the mean but leaves centred deviations unchanged. The deviations from the sample mean must sum to zero, so only nine can vary freely; this motivates the denominator n−1n-1. The estimate 10 is not a guarantee that the population variance equals 10.

Try these examples

Open an example in chapter practice. Try it first, then read its solution. Use “Learn this step” to return to this unit.