Instatistics, thebias of an estimator (orbias function) is the difference between thisestimator'sexpected value and thetrue value of the parameter being estimated. An estimator or decision rule with zero bias is calledunbiased. In statistics, "bias" is anobjective property of an estimator. Bias is a distinct concept fromconsistency: consistent estimators converge in probability to the true value of the parameter, but may be biased or unbiased (seebias 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 inunbiased estimation of standard deviation); because a biased estimator may be unbiased with respect to different measures ofcentral tendency; because a biased estimator gives a lower value of someloss function (particularlymean squared error) compared with unbiased estimators (notably inshrinkage 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 themedian, rather than the mean (expected value), in which case one distinguishesmedian-unbiased from the usualmean-unbiasedness property. Mean-unbiasedness is not preserved under non-lineartransformations, though median-unbiasedness is (see§ Effect of transformations); for example, thesample 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]
Suppose we have astatistical model, parameterized by a real numberθ, giving rise to a probability distribution for observed data,, and a statistic which serves as anestimator ofθ based on any observed data. That is, we assume that our data follows some unknown distribution (whereθ is a fixed, unknown constant that is part of this distribution), and then we construct some estimator that maps observed data to values that we hope are close toθ. Thebias of relative to is defined as[2]
where denotesexpected value over the distribution (i.e., averaging over all possible observations). The second equation follows sinceθ is measurable with respect to the conditional distribution.
An estimator is said to beunbiased if its bias is zero for all values of the 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 is an unbiased estimator for parameterθ, it is not guaranteed in general that g() is an unbiased estimator forg(θ), unlessg is a linear function.[4]
In a simulation experiment concerning the properties of an estimator, the bias of the estimator may be assessed using themean signed difference.
The sample variance highlights two different issues about bias and risk. First, the “naive” estimator that divides bynis biased downward because the sample mean is estimated from the same data. Multiplying byn/(n−1) (Bessel’s correction) yields an unbiased estimator. Second, unbiasedness does not imply minimummean squared error.
SupposeX1, ...,Xn areindependent and identically distributed (i.i.d.) random variables withexpectationμ andvarianceσ2. If thesample mean and uncorrectedsample variance are defined as
thenS2 is a biased estimator ofσ2. This follows immediately from thelaw of total variance because
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 ratio between the biased (uncorrected) and unbiased estimates of the variance is known asBessel's correction. The sample mean, on the other hand, is an unbiased[5] estimator of the population mean μ.[3] The equality of the second term on the right-hand side in the equation above can be understood in terms ofBienaymé's identity,
The reason that an uncorrected sample variance,S2, is biased stems from the fact that the sample mean is anordinary least squares (OLS) estimator forμ: is the number that makes the sum as small as possible. That is, when any other number is plugged into this sum, the sum can only increase. In particular, the choice gives,
and then
The above discussion can be understood in geometric terms: the vector can be decomposed into the "mean part" and "variance part" by projecting to the direction of and to that direction's orthogonal complement hyperplane. One gets for the part along and for the complementary part. Since this is an orthogonal decomposition, Pythagorean theorem says, and taking expectations we get, as above (but times).If the distribution of is rotationally symmetric, as in the case when are sampled from a Gaussian, then on average, the dimension along contributes to equally as the directions perpendicular to, so that and. This is in fact true in general, as explained above.
A far more extreme case of a biased estimator being better than any unbiased estimator arises from thePoisson distribution.[6][7] Suppose thatX has a Poisson distribution with expectation λ. Suppose it is desired to estimate
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, thene−2λ (the estimand) is the probability that no calls arrive in the next two minutes.)
Since the expectation of an unbiased estimatorδ(X) is equal to theestimand, i.e.
the only function of the data constituting an unbiased estimator is
To see this, note that when decomposing e−λ from the above expression for expectation, the sum that is left is aTaylor series expansion of e−λ as well, yielding e−λe−λ = e−2λ (seeCharacterizations of the exponential function).
If the observed value ofX 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, ifX 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
is far better than this unbiased estimator. Not only is its value always positive but it is also more accurate in the sense that itsmean squared error
is smaller; compare the unbiased estimator's MSE of
The MSEs are functions of the true value λ. The bias of the maximum-likelihood estimator is:
The bias of maximum-likelihood estimators can be substantial. Consider a case wheren tickets numbered from 1 ton are placed in a box and one is selected at random, giving a valueX. Ifn is unknown, then the maximum-likelihood estimator ofn isX, even though the expectation ofX givenn is only (n + 1)/2; we can be certain only thatn is at leastX and is probably more. In this case, the natural unbiased estimator is 2X − 1.
The theory ofmedian-unbiased estimators was revived by George W. Brown in 1947:[8]
An estimate of a one-dimensional parameter θ will be said to be median-unbiased, if, for fixed θ, the median of the distribution of the estimate is at the value θ; i.e., the estimate underestimates just as often as it overestimates. This requirement seems for most purposes to accomplish as much as the mean-unbiased requirement and has the additional property that it is invariant under one-to-one transformation.
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 andmaximum-likelihood estimators do not exist. They are invariant underone-to-one transformations.
There are methods of construction median-unbiased estimators for probability distributions that havemonotone 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.[11]
Any minimum-variancemean-unbiased estimator minimizes therisk (expected loss) with respect to the squared-errorloss function (among mean-unbiased estimators), as observed byGauss.[12] A minimum-average absolute deviationmedian-unbiased estimator minimizes the risk with respect to theabsolute loss function (among median-unbiased estimators), as observed byLaplace.[12][13] Other loss functions are used in statistics, particularly inrobust statistics.[12][14]
For univariate parameters, median-unbiased estimators remain median-unbiased undertransformations 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. ByJensen's inequality, aconvex function as transformation will introduce positive bias, while aconcave 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 functionf and a mean-unbiased estimatorU of a parameterp, the composite estimatorf(U) need not be a mean-unbiased estimator off(p). For example, thesquare root of the unbiased estimator of the populationvariance isnot a mean-unbiased estimator of the populationstandard deviation: the square root of the unbiasedsample variance, the correctedsample 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 – seeunbiased estimation of standard deviation for a discussion in this case.

While bias quantifies theaverage 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 themean square error,[2]This can be shown to be equal to the square of the bias, plus the variance:[2]
When the parameter is a vector, an analogous decomposition applies:[15]where is the trace (diagonal sum) of thecovariance matrix of the estimator and is the squarevector norm.
For example,[16] suppose an estimator of the form
is sought for the population variance as above, but this time to minimise the MSE:
If the variablesX1 ...Xn follow a normal distribution, thennS2/σ2 has achi-squared distribution withn − 1 degrees of freedom, giving:
and so
With a little algebra it can be confirmed that it isc = 1/(n + 1) which minimises this combined loss function, rather thanc = 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 abias–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.
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 theBayesian 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 thedata which are known, and fixed, and it is the unknown parameter for which an attempt is made to construct a probability distribution, usingBayes' theorem:
Here the second term, thelikelihood 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, theprior 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 optimisec in the expected loss function
A standard choice of uninformative prior for this problem is theJeffreys prior,, which is equivalent to adopting a rescaling-invariant flat prior forln(σ2).
One consequence of adopting this prior is thatS2/σ2 remains apivotal quantity, i.e. the probability distribution ofS2/σ2 depends only onS2/σ2, independent of the value ofS2 or σ2:
However, while
in contrast
— when the expectation is taken over the probability distribution of σ2 givenS2, as it is in the Bayesian case, rather thanS2 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 ascaled inverse chi-squared distribution withn − 1 degrees of freedom for the posterior probability distribution of σ2. The expected loss is minimised whencnS2 = <σ2>; this occurs whenc = 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.