Bias of an estimator explained

In statistics, the bias of an estimator (or bias function) is the difference between this estimator's expected value and the true value of the parameter being estimated. An estimator or decision rule with zero bias is called unbiased. In statistics, "bias" is an property of an estimator. Bias is a distinct concept from consistency: consistent estimators converge in probability to the true value of the parameter, but may be biased or unbiased (see bias versus consistency for more).

All else being equal, an unbiased estimator is preferable to a biased estimator, although in practice, biased estimators (with generally small bias) are frequently used. When a biased estimator is used, bounds of the bias are calculated. A biased estimator may be used for various reasons: because an unbiased estimator does not exist without further assumptions about a population; because an estimator is difficult to compute (as in unbiased estimation of standard deviation); because a biased estimator may be unbiased with respect to different measures of central tendency; because a biased estimator gives a lower value of some loss function (particularly mean squared error) compared with unbiased estimators (notably in shrinkage estimators); or because in some cases being unbiased is too strong a condition, and the only unbiased estimators are not useful.

Bias can also be measured with respect to the median, rather than the mean (expected value), in which case one distinguishes median-unbiased from the usual mean-unbiasedness property. Mean-unbiasedness is not preserved under non-linear transformations, though median-unbiasedness is (see); for example, the sample variance is a biased estimator for the population variance. These are all illustrated below.

An unbiased estimator for a parameter need not always exist. For example, there is no unbiased estimator for the reciprocal of the parameter of a binomial random variable.[1]

Definition

Suppose we have a statistical model, parameterized by a real number θ, giving rise to a probability distribution for observed data,

P\theta(x)=P(x\mid\theta)

, and a statistic

\hat\theta

which serves as an estimator of θ based on any observed data

x

. That is, we assume that our data follows some unknown distribution

P(x\mid\theta)

(where θ is a fixed, unknown constant that is part of this distribution), and then we construct some estimator

\hat\theta

that maps observed data to values that we hope are close to θ. The bias of

\hat\theta

relative to

\theta

is defined as[2]

\operatorname{Bias}(\hat\theta,\theta)=\operatorname{Bias}\theta[\hat\theta]=\operatorname{E}x\mid\theta[\hat{\theta}]-\theta=\operatorname{E}x\mid\theta[\hat\theta-\theta],

where

\operatorname{E}x\mid\theta

denotes expected value over the distribution

P(x\mid\theta)

(i.e., averaging over all possible observations

x

). The second equation follows since θ is measurable with respect to the conditional distribution

P(x\mid\theta)

.

An estimator is said to be unbiased if its bias is equal to zero for all values of parameter θ, or equivalently, if the expected value of the estimator matches that of the parameter.[3] Unbiasedness is not guaranteed to carry over. For example, if

\hat\theta

is an unbiased estimator for parameter θ, it is not guaranteed that g(

\hat\theta

) is an unbiased estimator for g(θ).[4]

In a simulation experiment concerning the properties of an estimator, the bias of the estimator may be assessed using the mean signed difference.

Examples

Sample variance

The sample variance of a random variable demonstrates two aspects of estimator bias: firstly, the naive estimator is biased, which can be corrected by a scale factor; second, the unbiased estimator is not optimal in terms of mean squared error (MSE), which can be minimized by using a different scale factor, resulting in a biased estimator with lower MSE than the unbiased estimator. Concretely, the naive estimator sums the squared deviations and divides by n, which is biased. Dividing instead by n − 1 yields an unbiased estimator. Conversely, MSE can be minimized by dividing by a different number (depending on distribution), but this results in a biased estimator. This number is always larger than n − 1, so this is known as a shrinkage estimator, as it "shrinks" the unbiased estimator towards zero; for the normal distribution the optimal value is n + 1.

Suppose X1, ..., Xn are independent and identically distributed (i.i.d.) random variables with expectation μ and variance σ2. If the sample mean and uncorrected sample variance are defined as

\overline{X}=1
n
n
\sum
i=1

Xi   

2=1
n
S
2
\sum
i-\overline{X})

  

then S2 is a biased estimator of σ2, because

\begin{align} \operatorname{E}[S2] &=\operatorname{E}\left[

1
n
n
\sum
i=1
2
(X
i-\overline{X})

\right] =\operatorname{E}[

1
n
n
\sum
i=1
2
((X
i-\mu)-(\overline{X}-\mu))

]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
((X
i-\mu)

- 2(\overline{X}-\mu)(Xi-\mu)+ (\overline{X}-\mu)2)]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

-

2
n

(\overline{X}-\mu)

n
\sum
i=1

(Xi-\mu)+

1
n

(\overline{X}-\mu)2

n
\sum
i=1

1]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

-

2
n
n
(\overline{X}-\mu)\sum
i=1

(Xi-\mu)+

1
n

(\overline{X}-\mu)2n]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

-

2
n
n
(\overline{X}-\mu)\sum
i=1

(Xi-\mu)+ (\overline{X}-\mu)2]\\[8pt] \end{align}

To continue, we note that by subtracting

\mu

from both sides of

\overline{X}=

1
n
nX
\sum
i
, we get

\begin{align} \overline{X}-\mu=

1
n
n
\sum
i=1

Xi-\mu=

1
n
n
\sum
i=1

Xi-

1
n
n\mu =
\sum
i=1
1
n
n
\sum
i=1

(Xi-\mu).\\[8pt] \end{align}

Meaning, (by cross-multiplication)

n

n
(\overline{X}-\mu)=\sum
i=1

(Xi-\mu)

. Then, the previous becomes:

\begin{align} \operatorname{E}[S2] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

-

2
n
n
(\overline{X}-\mu)\sum
i=1

(Xi-\mu)+ (\overline{X}-\mu)2]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

-

2
n

(\overline{X}-\mu)n(\overline{X}-\mu)+ (\overline{X}-\mu)2]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

- 2(\overline{X}-\mu)2+ (\overline{X}-\mu)2]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

-(\overline{X}-\mu)2]\\[8pt] &=\operatorname{E}[

1
n
n
\sum
i=1
2]
(X
i-\mu)

-\operatorname{E}[(\overline{X}-\mu)2]\\[8pt] &=\sigma2-\operatorname{E}[(\overline{X}-\mu)2] =\left(1-

1
n

\right)\sigma2<\sigma2. \end{align}

This can be seen by noting the following formula, which follows from the Bienaymé formula, for the term in the inequality for the expectation of the uncorrected sample variance above:

\operatorname{E}[(\overline{X}-\mu)2]=

1
n

\sigma2

.

In other words, the expected value of the uncorrected sample variance does not equal the population variance σ2, unless multiplied by a normalization factor. The sample mean, on the other hand, is an unbiased[5] estimator of the population mean μ.

Note that the usual definition of sample variance is

2=1
n-1
S
2
\sum
i-\overline{X})
, and this is an unbiased estimator of the population variance.

Algebraically speaking,

\operatorname{E}[S2]

is unbiased because:

\begin{align} \operatorname{E}[S2] &=\operatorname{E}\left[

1
n-1
n
\sum
i=1
2
(X
i-\overline{X})

\right] =

n
n-1

\operatorname{E}\left[

1
n
n
\sum
i=1
2
(X
i-\overline{X})

\right]\\[8pt] &=

n
n-1

\left(1-

1
n

\right)\sigma2=\sigma2,\\[8pt] \end{align}

where the transition to the second line uses the result derived above for the biased estimator. Thus

\operatorname{E}[S2]=\sigma2

, and therefore
2=1
n-1
S
2
\sum
i-\overline{X})
is an unbiased estimator of the population variance, σ2. The ratio between the biased (uncorrected) and unbiased estimates of the variance is known as Bessel's correction.

The reason that an uncorrected sample variance, S2, is biased stems from the fact that the sample mean is an ordinary least squares (OLS) estimator for μ:

\overline{X}

is the number that makes the sum
n
\sum
i=1
2
(X
i-\overline{X})
as small as possible. That is, when any other number is plugged into this sum, the sum can only increase. In particular, the choice

\mu\ne\overline{X}

gives,
1
n
n
\sum
i=1
2
(X
i-\overline{X})

<

1
n
n
\sum
i=1
2,
(X
i-\mu)
and then

\begin{align} \operatorname{E}[S2] &=\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\overline{X})

] <\operatorname{E}[

1
n
n
\sum
i=1
2
(X
i-\mu)

]=\sigma2. \end{align}

The above discussion can be understood in geometric terms: the vector

\vec{C}=(X1-\mu,\ldots,Xn-\mu)

can be decomposed into the "mean part" and "variance part" by projecting to the direction of

\vec{u}=(1,\ldots,1)

and to that direction's orthogonal complement hyperplane. One gets

\vec{A}=(\overline{X}-\mu,\ldots,\overline{X}-\mu)

for the part along

\vec{u}

and

\vec{B}=(X1-\overline{X},\ldots,Xn-\overline{X})

for the complementary part. Since this is an orthogonal decomposition, Pythagorean theorem says

|\vec{C}|2=|\vec{A}|2+|\vec{B}|2

, and taking expectations we get

n\sigma2=n\operatorname{E}\left[(\overline{X}-\mu)2\right]+n\operatorname{E}[S2]

, as above (but times

n

).If the distribution of

\vec{C}

is rotationally symmetric, as in the case when

Xi

are sampled from a Gaussian, then on average, the dimension along

\vec{u}

contributes to

|\vec{C}|2

equally as the

n-1

directions perpendicular to

\vec{u}

, so that

\operatorname{E}\left[(\overline{X}-\mu)2\right]=

\sigma2
n
and

\operatorname{E}[S2]=

(n-1)\sigma2
n
. This is in fact true in general, as explained above.

Estimating a Poisson probability

A far more extreme case of a biased estimator being better than any unbiased estimator arises from the Poisson distribution.[6] [7] Suppose that X has a Poisson distribution with expectation λ. Suppose it is desired to estimate

\operatorname{P}(X=0)2=e-2λ

with a sample of size 1. (For example, when incoming calls at a telephone switchboard are modeled as a Poisson process, and λ is the average number of calls per minute, then e−2λ is the probability that no calls arrive in the next two minutes.)

Since the expectation of an unbiased estimator δ(X) is equal to the estimand, i.e.

\operatorname

infty
E(\delta(X))=\sum
x=0

\delta(x)

λxe
x!

=e-2λ,

the only function of the data constituting an unbiased estimator is

\delta(x)=(-1)x.

To see this, note that when decomposing eλ from the above expression for expectation, the sum that is left is a Taylor series expansion of eλ as well, yielding eλeλ = e−2λ (see Characterizations of the exponential function).

If the observed value of X is 100, then the estimate is 1, although the true value of the quantity being estimated is very likely to be near 0, which is the opposite extreme. And, if X is observed to be 101, then the estimate is even more absurd: It is −1, although the quantity being estimated must be positive.

The (biased) maximum likelihood estimator

e-2{X

}\quad

is far better than this unbiased estimator. Not only is its value always positive but it is also more accurate in the sense that its mean squared error

e-4λ

λ(1/e2-3)
-2e
λ(1/e4-1)
+e

is smaller; compare the unbiased estimator's MSE of

1-e-4λ.

The MSEs are functions of the true value λ. The bias of the maximum-likelihood estimator is:

e-2λ

λ(1/e2-1)
-e

.

Maximum of a discrete uniform distribution

See main article: Maximum of a discrete uniform distribution. The bias of maximum-likelihood estimators can be substantial. Consider a case where n tickets numbered from 1 through to n are placed in a box and one is selected at random, giving a value X. If n is unknown, then the maximum-likelihood estimator of n is X, even though the expectation of X given n is only (n + 1)/2; we can be certain only that n is at least X and is probably more. In this case, the natural unbiased estimator is 2X − 1.

Median-unbiased estimators

The theory of median-unbiased estimators was revived by George W. Brown in 1947:[8]

Further properties of median-unbiased estimators have been noted by Lehmann, Birnbaum, van der Vaart and Pfanzagl.[9] In particular, median-unbiased estimators exist in cases where mean-unbiased and maximum-likelihood estimators do not exist. They are invariant under one-to-one transformations.

There are methods of construction median-unbiased estimators for probability distributions that have monotone likelihood-functions, such as one-parameter exponential families, to ensure that they are optimal (in a sense analogous to minimum-variance property considered for mean-unbiased estimators).[10] [11] One such procedure is an analogue of the Rao–Blackwell procedure for mean-unbiased estimators: The procedure holds for a smaller class of probability distributions than does the Rao–Blackwell procedure for mean-unbiased estimation but for a larger class of loss-functions.

Bias with respect to other loss functions

Any minimum-variance mean-unbiased estimator minimizes the risk (expected loss) with respect to the squared-error loss function (among mean-unbiased estimators), as observed by Gauss.[12] A minimum-average absolute deviation median-unbiased estimator minimizes the risk with respect to the absolute loss function (among median-unbiased estimators), as observed by Laplace.[13] Other loss functions are used in statistics, particularly in robust statistics.[14]

Effect of transformations

For univariate parameters, median-unbiased estimators remain median-unbiased under transformations that preserve order (or reverse order).Note that, when a transformation is applied to a mean-unbiased estimator, the result need not be a mean-unbiased estimator of its corresponding population statistic. By Jensen's inequality, a convex function as transformation will introduce positive bias, while a concave function will introduce negative bias, and a function of mixed convexity may introduce bias in either direction, depending on the specific function and distribution. That is, for a non-linear function f and a mean-unbiased estimator U of a parameter p, the composite estimator f(U) need not be a mean-unbiased estimator of f(p). For example, the square root of the unbiased estimator of the population variance is a mean-unbiased estimator of the population standard deviation: the square root of the unbiased sample variance, the corrected sample standard deviation, is biased. The bias depends both on the sampling distribution of the estimator and on the transform, and can be quite involved to calculate – see unbiased estimation of standard deviation for a discussion in this case.

Bias, variance and mean squared error

See main article: Bias–variance tradeoff.

While bias quantifies the average difference to be expected between an estimator and an underlying parameter, an estimator based on a finite sample can additionally be expected to differ from the parameter due to the randomness in the sample.An estimator that minimises the bias will not necessarily minimise the mean square error.One measure which is used to try to reflect both types of difference is the mean square error,

\operatorname{MSE}(\hat{\theta})=\operatorname{E}[(\hat{\theta}-\theta)2].

This can be shown to be equal to the square of the bias, plus the variance:

\begin{align} \operatorname{MSE}(\hat{\theta})=&(\operatorname{E}[\hat{\theta}]-\theta)2+\operatorname{E}[(\hat{\theta}-\operatorname{E}[\hat{\theta}])2]\\ =&(\operatorname{Bias}(\hat{\theta},\theta))2+\operatorname{Var}(\hat{\theta}) \end{align}

When the parameter is a vector, an analogous decomposition applies:[15]

\operatorname{MSE}(\hat{\theta})=\operatorname{trace}(\operatorname{Cov}(\hat{\theta})) +\left\Vert\operatorname{Bias}(\hat{\theta},\theta)\right\Vert2

where

\operatorname{trace}(\operatorname{Cov}(\hat{\theta}))

is the trace (diagonal sum) of the covariance matrix of the estimator and

\left\Vert\operatorname{Bias}(\hat{\theta},\theta)\right\Vert2

is the square vector norm.

Example: Estimation of population variance

For example,[16] suppose an estimator of the form

T2=c

2
\sum
i-\overline{X}\right)

=cnS2

is sought for the population variance as above, but this time to minimise the MSE:

\begin{align}\operatorname{MSE}=&\operatorname{E}\left[(T2-\sigma2)2\right]\\ =&\left(\operatorname{E}\left[T2-\sigma2\right]\right)2+\operatorname{Var}(T2)\end{align}

If the variables X1 ... Xn follow a normal distribution, then nS22 has a chi-squared distribution with n - 1 degrees of freedom, giving:

\operatorname{E}[nS2]=(n-1)\sigma2and\operatorname{Var}(nS2)=2(n-1)\sigma4.

and so

\operatorname{MSE}=(c(n-1)-1)2\sigma4+2c2(n-1)\sigma4

With a little algebra it can be confirmed that it is c = 1/(n + 1) which minimises this combined loss function, rather than c = 1/(n - 1) which minimises just the square of the bias.

More generally it is only in restricted classes of problems that there will be an estimator that minimises the MSE independently of the parameter values.

However it is very common that there may be perceived to be a bias–variance tradeoff, such that a small increase in bias can be traded for a larger decrease in variance, resulting in a more desirable estimator overall.

Bayesian view

Most bayesians are rather unconcerned about unbiasedness (at least in the formal sampling-theory sense above) of their estimates. For example, Gelman and coauthors (1995) write: "From a Bayesian perspective, the principle of unbiasedness is reasonable in the limit of large samples, but otherwise it is potentially misleading."[17]

Fundamentally, the difference between the Bayesian approach and the sampling-theory approach above is that in the sampling-theory approach the parameter is taken as fixed, and then probability distributions of a statistic are considered, based on the predicted sampling distribution of the data. For a Bayesian, however, it is the data which are known, and fixed, and it is the unknown parameter for which an attempt is made to construct a probability distribution, using Bayes' theorem:

p(\theta\midD,I)\proptop(\theta\midI)p(D\mid\theta,I)

Here the second term, the likelihood of the data given the unknown parameter value θ, depends just on the data obtained and the modelling of the data generation process. However a Bayesian calculation also includes the first term, the prior probability for θ, which takes account of everything the analyst may know or suspect about θ before the data comes in. This information plays no part in the sampling-theory approach; indeed any attempt to include it would be considered "bias" away from what was pointed to purely by the data. To the extent that Bayesian calculations include prior information, it is therefore essentially inevitable that their results will not be "unbiased" in sampling theory terms.

But the results of a Bayesian approach can differ from the sampling theory approach even if the Bayesian tries to adopt an "uninformative" prior.

For example, consider again the estimation of an unknown population variance σ2 of a Normal distribution with unknown mean, where it is desired to optimise c in the expected loss function

\operatorname{ExpectedLoss}=\operatorname{E}\left[\left(cnS2-\sigma2\right)2\right]=\operatorname{E}\left[\sigma4\left(cn\tfrac{S2}{\sigma2}-1\right)2\right]

A standard choice of uninformative prior for this problem is the Jeffreys prior,

\scriptstyle{p(\sigma2)\propto1/\sigma2}

, which is equivalent to adopting a rescaling-invariant flat prior for ln(σ2).

One consequence of adopting this prior is that S22 remains a pivotal quantity, i.e. the probability distribution of S22 depends only on S22, independent of the value of S2 or σ2:

p\left(\tfrac{S2}{\sigma2}\midS2\right)=p\left(\tfrac{S2}{\sigma2}\mid\sigma2\right)=g\left(\tfrac{S2}{\sigma2}\right)

However, while

\operatorname{E}
p(S2\mid\sigma2)

\left[\sigma4\left(cn\tfrac{S2}{\sigma2}-1\right)2\right]=\sigma4

\operatorname{E}
p(S2\mid\sigma2)

\left[\left(cn\tfrac{S2}{\sigma2}-1\right)2\right]

in contrast

\operatorname{E}
p(\sigma2\midS2)

\left[\sigma4\left(cn\tfrac{S2}{\sigma2}-1\right)2\right]\sigma4

\operatorname{E}
p(\sigma2\midS2)

\left[\left(cn\tfrac{S2}{\sigma2}-1\right)2\right]

— when the expectation is taken over the probability distribution of σ2 given S2, as it is in the Bayesian case, rather than S2 given σ2, one can no longer take σ4 as a constant and factor it out. The consequence of this is that, compared to the sampling-theory calculation, the Bayesian calculation puts more weight on larger values of σ2, properly taking into account (as the sampling-theory calculation cannot) that under this squared-loss function the consequence of underestimating large values of σ2 is more costly in squared-loss terms than that of overestimating small values of σ2.

The worked-out Bayesian calculation gives a scaled inverse chi-squared distribution with n - 1 degrees of freedom for the posterior probability distribution of σ2. The expected loss is minimised when cnS2 = <σ2>; this occurs when c = 1/(n - 3).

Even with an uninformative prior, therefore, a Bayesian calculation may not give the same expected-loss minimising result as the corresponding sampling-theory calculation.

See also

References

Notes and References

  1. Web site: For the binomial distribution, why does no unbiased estimator exist for $1/p$? . 2023-12-27 . Mathematics Stack Exchange . en.
  2. Web site: Kozdron. Michael. March 2016. Evaluating the Goodness of an Estimator: Bias, Mean-Square Error, Relative Efficiency (Chapter 3). 2020-09-11. stat.math.uregina.ca.
  3. Web site: Taylor. Courtney. January 13, 2019. Unbiased and Biased Estimators. 2020-09-12. ThoughtCo. en.
  4. Book: A modern introduction to probability and statistics: understanding why and how . 2005 . Springer . 978-1-85233-896-1 . Dekking . Michel . Springer texts in statistics . London [Heidelberg].
  5. Book: Richard Arnold Johnson. Dean W. Wichern. Applied Multivariate Statistical Analysis. 10 August 2012. 2007. Pearson Prentice Hall. 978-0-13-187715-3.
  6. Book: J. P. . Romano . A. F. . Siegel . 1986 . Counterexamples in Probability and Statistics . Counterexamples in Probability and Statistics . Wadsworth & Brooks / Cole . Monterey, California, USA . 168.
  7. M.. An Illuminating Counterexample . 3647938. American Mathematical Monthly. 110. 1 March 2003 . 3. 234–238. 0002-9890 . 10.2307/3647938. Hardy. math/0206006.
  8. Brown (1947), page 583
  9. ; ;
  10. Pfanzagl . Johann . On optimal median unbiased estimators in the presence of nuisance parameters . The Annals of Statistics . 1979 . 7 . 1 . 187–193 . 10.1214/aos/1176344563 . free .
  11. Brown . L. D. . Cohen . Arthur . Strawderman . W. E. . A Complete Class Theorem for Strict Monotone Likelihood Ratio With Applications . Ann. Statist. . 4 . 1976 . 4 . 712–722 . 10.1214/aos/1176343543 . free .
  12. Book: Statistical Data Analysis Based on the L1-Norm and Related Methods . Papers from the First International Conference held at Neuchâtel, August 31–September 4, 1987 . Yadolah . Dodge . North-Holland . Amsterdam . 1987 . 0-444-70273-3 .
  13. Book: Jaynes . E. T. . Probability Theory : The Logic of Science . 2007 . Cambridge Univ. Press . Cambridge . 978-0-521-59271-0 . 172 .
  14. Book: Loss Functions and the Theory of Unbiased Estimation . Robust and Non-Robust Models in Statistics . Lev B. . Klebanov . Svetlozar T. . Rachev . Frank J. . Fabozzi . Nova Scientific . New York . 2009 . 978-1-60741-768-2 .
  15. Web site: Taboga . Marco . Lectures on probability theory and mathematical statistics . 2010.
  16. Book: DeGroot, Morris H. . 1986 . Probability and Statistics . limited . 2nd . Addison-Wesley . 0-201-11366-X . 414–5 . But compare it with, for example, the discussion in Book: Casella . Berger . 2001 . Statistical Inference . 2nd . Duxbury . 0-534-24312-6 . 332 .
  17. Book: A. . Gelman . 1 . John S. . Carlin . Hal S. . Stern . Donald B. . Rubin . 1995 . Bayesian Data Analysis . Chapman and Hall . 0-412-03991-5 . 108 .