In Section 12.1 we discussed two methods for deriving estimators.
If the quantity of interest is some summary feature of an unknown distribution, use sample data to form an empirical distribution, and estimate the unknown quantity by computing the same summary on the empirical distribution.
If the quantity of interest is a parameter of a data generating process that assigns chances to observed outcomes, estimate the unknown parameter, or combination of unknown parameters, via the values that would make the observed data most likely.
While these procedures for selecting estimators are reasonable, they don’t give any guarantee on the quality of the estimator. They say nothing about the reliability of the estimator, its accuracy, or the ways in which it tends to make mistakes.
In this section we will identify some properties of estimators that can be used the measure their quality. These are commonly used to compare estimators and to help select between estimators when multiple reasonable estimators are available.
The Distribution of Estimates¶
Before identifying useful properties, we should clarify how we think about estimators. An estimator is a function. An estimate is the answer returned when we apply that function to an observed dataset. Once the dataset is observed, it is no longer random, so any particular estimate is just a number. This is how we thought about estimates in the previous section. We always started by saying, suppose that we observed , then applied the estimator to .
The quality of an individual estimate is easy to think about. The estimate is good if the error is small. However, the quality of a single estimate doesn’t depend on the process that produces it. An unreliable process could produce a good estimate by accident, and a reliable process could return a bad estimate by accident.
So, if we want to understand the quality of the estimation process, e.g. the estimator, then we need to consider the distribution of possible estimates it might return as a function of the possible datasets we could receive. Instead of measuring the quality of a single estimate, if we want to compare estimators we should consider how they would behave given hypothetical data.
For example, imagine that you needed to choose an estimator before you observed any data. Then, you would consider how the estimator might behave, over all possible datasets. From this perspective, the estimate returned by the estimator is a function of a random variable, the data before observation, so is itself random.
Properties¶
Here are some properties we might want in an estimator:
Since we can never collect infinitely many observations in practice, we care about consistency since, to prove consistency, we usually have to show that the estimator provides accurate estimates with high probability given sufficiently many observations.
Statements involving infinitely many observations are asymptotic. Consistency is an asymptotic guarantee. Guarantees involving finitely many observations are finite sample guarantees.
Here’s an example finite-sample guarantee:
The bias of an estimator, unlike the error in the estimate, is not a random quantity. It is determined by the distribution of the estimates, .
Estimators based on sample averages are often unbiased.
For example, in the last chapter we derived the maximum likelihood estimator for given . We saw that . What is the bias in this estimator?
If then . So, the bias is:
So, the estimator is unbiased.
Not all maximum likelihood estimators are unbiased. For example, if , and we adopt the maximum likelihood estimator , then the bias is:
To show that this estimator is biased, we’ll use Jensen’s inequality (see Section 4.1); the expected value of a convex function of a random variable is greater than the convex function of the expectation. Since the function is a convex function of :
The expected value of a geometric random variable with success probability is (see Sections 7.1 and 10.2). Therefore:
It follows that the bias in the estimator is positive:
So, the maximum likelihood estimator for the parameter of a geometric random variable is a biased estimator. On average, its estimates will overestimate the unknown .
Bias and Sample Size
If we collect independent samples from a geometric distribution with unknown parameter , then the maximum likelihood estimator for is:
We know that this estimator is biased when . Let’s show it is biased for all finite . To show it remains biased, we will use Jensen’s inequality again:
We can simplify the denominator using expectation properties. Since expectations are linear and additive (see Section 4.2):
Then, since the expected value of a geometric random variable with parameter is :
So, by Jensen:
so the estimator remains baised for all finite . No matter how many samples we observe, it will overestimate on average.
Nevertheless, the bias in the estimator decreases as the sample size increases, and converges to zero as approaches infinity. So, while the bias is never zero for any finite , we could make it arbitrarily small by using a large enough sample. Estimators with this property are asymptotically unbiased.
Exact Analysis of Bias
In some cases we can analyze the bias in an estimator exactly.
For example, suppose that are drawn independently and identically. Suppose that is unknown. Then, the maximum likelihood estimator for , given the observation is:
So, as a random variable:
where is the sample average, .
This estimator is biased for the same reason the estimator for the parameter of a Geometric is biased. Applying Jensen:
The expected value of is since the samples are identically distributed. The expected value of an exponential random variable is the reciprocal of its parameter (see Section 7.1) so:
Therefore, the estimator has a positive bias.
In this case we can work out the exact value of the bias as a function of and .
First, let . Then so:
The random variable, is the sum of independent, identical exponential random variables. So, we can work out its density function using the convolution formula (see Section 10.3). In Section 10.3, we derived the density for :
This is an example of a Gamma random variable with shape parameter 2 and rate parameter . On your 11th homework you iterated this analysis to show that the sum of independent, identical random variables with rate parameter is a Gamma random variable with shape parameter and rate parameter :
We can now find directly:
To work out the integral, integrate by parts (see Section 7.1). You evaluated this integral on your 8th homework. In general:
So:
Therefore:
Then, the expected estimate to is:
This expectation is larger than for all finite since . The exact bias is:
So, while the estimator is biased, its bias decreases as we account for more observations. In particular, the bias in the estimator is proportional to , so decays to zero at rate .
In other words, the maximum likelihood estimator to the parameter of an exponential distribution, based on independent, identical samples, is asymptotically unbiased. The bias in the estimator converges to zero as diverges!
An estimator could be unbiased and consistent, yet return wildly varying estimates given finitely many observations.
We usually look for estimators that are both unbiased and precise since these estimators reliably return accurate estimates. To understand accuracy we should measure the expected size of the errors produced by the estimator.
The mean square error is a popular measure of accuracy since we can decompose it into a contribution from the bias and a contribution from the precision of the estimator. Let . Then:
Let denote the bias in the estimator. Let denote the centered variable . Then, we can use the linearity of expectation to expand the MSE:
The expected value of any centered variable is zero, so . Therefore:
The first term is the expected square of a centered variable, so is the variance in the variable. Thus, the mean square error decomposes into a sum of the variance in the estimator plus the bias in the estimator squared:
So, to make our estimators as accurate as possible, we will usually try to minimize the variance and the bias in the estimator at the same time. Usually, there is a trade-off between bias and variance. In many cases we cannot send both to zero, so need to decide whether we are more willing to except systematic errors associated with a bias, or random errors associated with fluctuations in the data.
This trade-off is a fundamental idea in estimation. You’ll see it more in future courses. Often, we can reduce the variance in an estimator only by admitting a bias.
You can think about the trade-off this way. If our estimator is as accurate as possible, then we can’t reduce both the bias and the variance, otherwise we could find a more accurate estimator.
In practice, the trade-off between bias and variance usually represents a trade-off associated with incorporating some prior information about the unknown. This prior information might be modeled by fixing a distribution over the unknown (the Bayesian approach), or by explicitly biasing the estimator closer to some fixed value that we think would be a good estimate in the absence of any data (the Frequentist approach). The latter idea is called “regularization.”
Both approaches make the estimator less variable by making it less sensitive to the data. This reduces the variance, but typically increases the bias, since by making the estimator less sensitive, we keep it closer to some prior estimate we would have made in absence of any data. By biasing our estimator towards the estimate we would have made in absence of data, we bias it away from the true value. This can improve the overall accuracy of the estimator if the reduction in variance outweighs the added error due to bias.