























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























We’ve established some solid foundations; now we can get to what is really the heart of statistics.
“Point estimation” refers to the decision problem we were talking about last class: we observe data Xi drawn i.i.d. from p (^) θ (x)^16 , and our goal is to estimate the parameter θ ∈ Θ from the data. An “estimator” is any decision rule, that is, any function from the data space X N^ into the parameter space Θ. E.g. the sample mean, in the Gaussian case. Or the function that assigns “2” to every possible observed data sample.
There are two important functions associated with any estimator θˆ that are useful as a thumbnail sketch of how well the estimator is doing: the “bias” B (^) ˆθ (θ) =
Eθ (θˆ−θ) =
−∞
−∞
i=
p (^) θ (Xi )
θ^ ˆ({X 1 , X 2 , ...XN })−θ
i=
dXi = Eθ (θˆ)−θ
and the variance V (^) ˆθ (θ) = Vθ (θˆ) There is a very useful relationship between the bias, variance, and the mean-square error (MSE) of any estimator. Using the usual rules for expec- tations of squares, it’s easy to show that the square error decomposes into a bias and variance term:
Eθ
(θ − θˆ)^2
= B (^) θˆ (θ)^2 + V (^) θˆ (θ)
So the MSE of an estimator can be simply described as a sum of a term measuring how far off the estimator is “on average” (not average square) and a term measuring the variability of the estimator.
(^16) Note that this is a huge assumption, or rather set of assumptions. We assume that
the data is mutually independent — that is, seeing one data point doesn’t affect the other data points at all — and even more strongly, that the true underlying distribution of the data happens, rather too conveniently, to some easy-to-analyze family of distributions p (^) θ (x), where θ is some simple parameter that tells us everything we need to know about the data. The message is to take all of the following with a grain of salt: this i.i.d. story is a simple, tractable model of the data — while it’s a very helpful model, as we’ll see, it’s important to remember that in 99% of cases it’s something of a caricature. (^17) HMC 4.
This bias-variance decomposition leads to another possible way to choose between all possible admissible estimators. (Recall that we discussed two such principles before, the Bayes — minimum average error — principle and the minimax — minimum worst-case error.) Here’s a third: choose the best unbiased estimator. That is, choose an estimator θˆ such that B (^) ˆθ (θ) = 0 ∀θ,
and such that the variance is minimized over the class of all such unbiased estimators. Unbiased estimators are right “on average,” which is not a bad thing to aim for (although the condition of exactly zero bias turns out to be pretty strong, ruling out a lot of otherwise good estimators, so it’s much more questionable whether we should exclude all estimators with any bias whatsoever). Exercise 52: Is the sample mean unbiased for Poisson data? Exercise 53: Provide an unbiased estimator for b if the data is U ([0, b]). Exercise 54: Provide an unbiased estimator for σ 2 , the variance param- eter of the Gaussian distribution N (μ, σ 2 ): 1) in the case that μ is known;
for any unbiased estimator θˆ; therefore an UMVUE dominates all other un- biased estimators under the squared-error cost function. In this case, it obviously makes sense to use the UMVUE. One last interesting thing to note: when a UMVUE does exist, it is automatically unique. Suppose U 1 and U 2 are both UMVUE, with variance V (θ), then the average U = (U 1 + U 2 )/2 is also an unbiased estimator. Now let’s look at the new function W = (U 1 − U 2 )/2. Now
This means VW = 0, i.e., U 1 = U 2 with probability 1.
Exercise 55: Is the sample mean from a Gaussian with known variance (say, N (μ, 1)) a UMVUE for the mean parameter μ? If not, can you think of one, or prove that none exists? (Hint: try the case N = 1, then N = 2, first.) Exercise 56: Is the sample maximum from a uniform distribution U (a, b) a UMVUE for the maximum parameter b? If not, can you think of one, or prove that none exists? (Hint: try the case N = 1, then N = 2, first.)
One very important thing to note about the unbiasedness property is that it is not invariant with respect to reparameterizations. That is, if we relabel the parameters, the estimator might not remain unbiased. This is, in fact, one of the strongest arguments that has been raised against the idea of re- stricting our attention to unbiased estimators. Exercise 57: Is the sample mean an unbiased estimator of
p, where p is the parameter of a binomial
distribution? What about the square root of the sample mean: is ˆp =
n/N an unbiased estimator of
p? The other big drawback, as mentioned above, is that unbiased estimators don’t necessarily exist. Exercise 58: Does an unbiased estimator exist for log p, where p is the parameter of a binomial distribution? If so, supply one; if not, prove it.
numerical optimization scheme. Sometimes we can find the optimum ana- lytically. For example, assume (as usual) that we have i.i.d. data Xi. This means that p (^) θ (D) =
i
p (^) θ (Xi ).
This suggests that we maximize the log-likelihood instead, since sums are easier to work with than products:
θˆ (^) M L = arg max θ
p (^) θ (D) = arg max θ
i
p (^) θ (Xi ) = arg max θ
i
log p (^) θ (Xi ).
Often we can take the gradient of
L(θ) ≡
i
log p (^) θ (Xi )
and set it to zero to obtain a local optimum; then we can sometimes addi- tionally argue that the optimum is unique. Exercise 59: Give a simple con- dition, in terms of the second derivative of the log-likelihood d^2 log p (^) θ (x)/dθ 2 , ensuring that the likelihood has a unique global maximum as a function of θ ∈ Θ. Here’s an example: let x (^) i be exponential. Then
p (^) θ ({x (^) i }) =
i
θe −θx^ i^ ,
so if we set the derivative of the loglikelihood equal to zero, we get
∂θ
N log θ −
i=
θx (^) i
θ=θˆM LE
=
θ^ ˆ (^) M LE
i
x (^) i ,
so we have that
θˆ (^) M LE =
i
x (^) i
the MLE for θ is just the inverse of the sample mean of x (^) i. This makes sense: if we see that the sample mean is very close to zero, then it seems likely that θ is large.
Exercise 60: Find the MLE for (μ, σ 2 ) for Gaussian data, given N i.i.d. data samples x (^) i. Is the MLE biased? If so, compute the bias. Exercise 61: Find the MLE for (a, b) for uniform U (a, b) data, given N i.i.d. data samples x (^) i. Is the MLE biased? If so, compute the bias.
One more important point about the MLE is that it is invariant with respect to reparameterizations. That is, if θˆ (^) M L is an MLE for θ, then g(θˆ (^) M L ) is an MLE for√ g(θ) whenever g(.) is invertible. For example, the MLE for σ is just ˆσ (^) M L^2. Exercise 62: Prove this.
One important application of ML estimation is to regression analysis. Un- fortunately we don’t have time to go very deeply into this very important topic; check out W4315 for more information. The basic model for regression is as follows: we see paired data {Xi , Y (^) i }, and we have reason to believe Xi and Y (^) i are related. In fact, we can hypoth- esize a model: Y (^) i = aXi + ei ,
where ei is some (unobserved) i.i.d. noise source; i.e., Y is given by aX, a linearly-scaled version of X, but contaminated by additive noise. Let’s assume that ei ∼ N (0, σ 2 ). What is the MLE for the parameters (a, σ 2 )? Well, first we write down the loglikelihood.
L(a, σ 2 ) =
i
log N (0, σ 2 )(Y (^) i − aXi )
i
− log(σ
2 π) −
(Y (^) i − aXi )^2 2 σ 2
Now if we take the gradient and set it to zero, we get two equations (one for a and one for σ 2 : (^) ∑
i
Xi (Y (^) i − ˆa (^) M L Xi ) = 0,
(^18) HMC 12.
Let’s look more closely at this likelihood idea. One thing that we saw was that not every bit of the data really mattered to our estimate. For example, if we have i.i.d. data, it doesn’t really matter what order the data appeared in. So we can throw out the order of the data and do inference given the unordered data just as well. Similarly, se saw that we didn’t need to remember everything about Gaus- sian data, just the sample mean and sample variance (or equivalently, the sample mean and sample mean square, since we can derive one from the other), since the likelihood depends on the data only through these statis- tics:
L(μ, σ 2 ) =
i
log N (μ, σ 2 )(Xi )
i
− log(σ
2 π) −
(Xi − μ)^2 2 σ 2
= −N log(σ
2 π) −
2 σ 2
i
X (^) i^2 − 2 μ
i
Xi + N μ 2
This is quite a savings: we’ve compressed N data points into just two. This turns out to be a pretty common phenomenon, if we think about it. We’re led to a definition: Any function T (D) of the data D (and only of the data D) is called a “statistic.” A statistic is called sufficient for the parameter θ if we can split the data into two parts: 1) the sufficient statistic, and 2) the aspects of the data that have nothing to do with estimating θ. More mathematically,
p (^) θ (D) = F (θ, T (D))G(D),
for some functions F (.) and G(.). This is equivalent (although we’ll skip the proof) to saying that the conditional distribution of the data D, given T (D), does not depend on θ at all. That is, the function
p (^) θ (D|T ) =
p (^) θ (T (D)|D)p (^) θ (D) p (^) θ (T (D))
p (^) θ (D) p (^) θ (T (D)) (^19) HMC 7.
does not depend on θ. (Yet another way of saying this: θ — T — D is a “Markov chain”: D is conditionally independent of θ given T , for any prior distribution on θ, i.e.
p(θ, D|T ) = p(θ|T )p(D|T ).)
Here are some more examples:
p (^) θ ({x (^) i }) =
i x^ i
p
P i x^ i^ (1 − p)N^ −
P i x^ i^ ;
from this we can easily see that n =
i x^ i^ is sufficient.
p (^) θ ({x (^) i }) =
i
e−θ^
θ x^ i x (^) i!
= e−N^ θ^
θ
P i x^ i ∏ i (x^ i^ !)
and once again
i x^ i^ is sufficient.
p (^) θ ({x (^) i }) =
i
(^1) [θ≥x (^) i ]
θ
θ N^
(^1) [θ≥max (^) i x (^) i ] ,
i.e., maxi x (^) i is sufficient.
p (^) θ ({x (^) i }) = 1[θ≤min (^) i x (^) i ] 1 [θ+1≥max (^) i x (^) i ]
i.e., the pair (min (^) i x (^) i , maxi x (^) i ) is sufficient (even though there is only one parameter θ).
Exercise 64: What is a sufficient statistic for exponential data, x (^) i ∼ exp(λ)? Exercise 65: What is a sufficient statistic for uniform data, x (^) i ∼ U ([a, b])? Exercise 66: What is a sufficient statistic for Gaussian data, x (^) i ∼ N (0, θ)? (I.e., the mean is known but the variance is not.) A couple things to note:
This condition is often much easier to check than whether a given statistic is a function of every other sufficient statistic. Example: x (^) i ∼ exp(θ). Then
p (^) θ (D) =
i=
θ exp(−θx (^) i ) = θ N^ exp(−θ
i=
x (^) i )
for x (^) i > 0 ∀i. Clearly
x (^) i is sufficient; is it minimal? Let’s apply the above theorem: choose another arbitrary data sample, D ′^ = {x ′ 1 , x ′ 2 , ..., x ′ N }. Now we can see that p (^) θ (D) p (^) θ (D ′^ )
= exp
θ(
x ′ i −
x (^) i )
is constant as a function of θ if and only if
x (^) i =
x ′ i. Thus
x (^) i is a minimal sufficient statistic; this was much easier to check than whether
x (^) i was a function of all other possible sufficient stats! Conversely, let’s look at a sufficient statistic which is not minimal, namely the full data D. Here it’s clear that 2 =⇒ 1 but 1 does not imply 2; hence, the full data D is not minimal. Here’s another one. Recall that (mini x (^) i , max (^) i x (^) i ) was sufficient for uni- form U [(θ, θ + 1]) data. It’s clear from this theorem that this statistic is also minimal. We’ll see more examples in a moment, when we discuss exponential fam- ilies. Exercise 71: Let x ∼ N (0, σ 2 ) (i.e., the mean is known but the variance is not). Is |x| sufficient for σ 2? If so, is it minimal? Exercise 72: Let x (^) i be drawn i.i.d. from a density in a “location family”; that is, we know f (x) and we know p (^) θ (x) = f (x − θ), we just want to know θ. Can you come up with a minimal sufficient statistic for θ (and, of course, prove that this statistic is minimal sufficient)? (Hint: the order statistics might be useful here, as it’s intuitively clear that we don’t need to remember what order the data actually came in.)
Not only does restricting our attention to sufficient statistics make life easier; it also improves (or at least can’t hurt) our estimation accuracy:
(^20) HMC 7.
Figure 12: Rao and Blackwell.
Theorem 4 (Rao-Blackwell).
E[g(E(θˆ|T ) − θ)] ≤ E[g(θˆ − θ)]
for any estimator θˆ, convex error function g, and sufficient statistic T. In particular, E[(E(θˆ|T ) − θ)^2 ] ≤ E[(θˆ − θ)^2 ]
In words, take any estimator θˆ. Then form the estimator E(θˆ|T ) (note that E(θˆ|T ) is a bona fide statistic — that is, doesn’t depend on θ — if T is sufficient). The theorem says that the risk of E(θˆ|T ) is never worse (and in practice, often better) than that of the original estimator θˆ, as long as the loss function g is convex. Also note that E(θˆ|T ) is unbiased whenever θˆ is (Exercise 73: Why?). We’ll prove the special (g(u) = u 2 ) case to give a sense of what’s going on here. Just write out E[(ˆθ − θ)^2 ]:
E[(θˆ − θ)^2 ] = ET
E[(θˆ − θ)^2 |T ]
= ET [(E(θˆ|T ) − θ)^2 ] + ET
E[(θˆ − E(θˆ|T ))^2 ]
≥ ET [(E(θˆ|T ) − θ)^2 ].
Now for the really useful part: if we look at multiple i.i.d. samples x (^) i , then it’s easy to see that
i k(x^ i^ ) is minimal sufficient for the full data^ {x^ i^ }. (Exercise 75: Prove this.) This saves a whole lot of work — to come up with a minimal s.s. (and therefore come up with an improved estimator, according to Rao-Blackwell), all we need to do is manipulate p (^) θ (x) into the above form. We’ll get some more practice with this in a moment. More generally, sometimes we need more than one statistic to adequately describe the data. In this case, we can define a k-dimensional exponential family as a parametric family satisfying
p (^) θ (x) =
exp
∑k j=1 fj^ (θ)kj^ (x) +^ s(x) +^ g(θ)
if a < x < b
0 otherwise.
Here, {kj (x)} 1 ≤j≤k are minimal sufficient together (but not alone). These concepts give us a canonical parameterization of our parametric family: fj (θ) (we call {fj (θ)} 1 ≤j≤k the “canonical parameter”), and the nat- ural parameter space is the set of all θ for which the above form makes sense, that is, the set of θ such that g(θ), as defined above, is finite. Exercise 76: Write out f (θ), k(x), s(x), and g(θ) for 1) N (μ, θ) (μ known), 2) B(N, θ), and 3) P oiss(θ). Write out fj (θ), kj (x), s(x), and g(θ) for the normal family in the case that both μ and σ 2 are unknown. Now to make life simpler assume we’re dealing with the canonical param- eterization, i.e. f (θ) = θ. Let’s look more closely at g(θ). First, there is some redundancy here: we know, since
p (^) θ (x)dx = 1, that
g(θ) = − log
exp[θk(x) + s(x)]dx
We can go a little further if we remember some of our facts about moment- generating functions and recognize that an mgf is hiding in the above defi- nitions. Now, remember that taking derivatives of mgf’s kicks out moments (hence the name). In this case, we have
∂g ∂θ
= −Eθ k(x).
This is because
∂g ∂θ
∂θ
log
exp[θk(x) + s(x)]dx
k(x) exp[θk(x) + s(x)]dx exp[−g(θ)]
=
p (^) θ (x)k(x)dx = Eθ k(x).
Exercise 77: Derive a relationship between g(θ), Eθ k(x), and the MLE by taking the derivative of the loglikelihood and setting it to zero. We can use similar techniques to show that
∂ 2 g ∂θ 2
= −Vθ k(x).
This, in turn, proves that the log-likelihood log p (^) θ (x) is a concave function of θ whenever θ is the canonical parameter of an exponential family, which you’ll recall is quite handy in the context of ML estimation. Exercise 78: Prove the above formula, and use this to establish the concavity of the log- likelihood in the canonical exponential family setting. Of course, exponential families are a special case; life isn’t always so easy. Exercise 79: Try writing U (a, b) in the exponential form. What goes wrong? (Hint: don’t forget to keep track of the support of U (a, b).) It’s interesting to note (though we won’t pursue this) that exponential families are the only ones for which a finite-dimensional sufficient statistic ex- ists for all sample sizes N. This is called the “Koopman - Darmois” theorem, if you want to read more about it. Exercise 80: Give a minimal sufficient statistic for Cauchy data.
“Completeness” of a statistic, in the context of a given probability family, is a property that guarantees the uniqueness of the unbiased estimator which may be written as a function of a sufficient statistic; this estimator is then automatically the UMVUE.
(^22) HMC 7.4.
Now we turn to the asymptotic properties of our estimators. We’ll discuss two questions in particular:
We say an estimator is consistent (in probability) if it provides us with the correct answer asymptotically. That is,
θˆ →P θ.
(More precisely, we’re talking about convergence of a sequence of estimators, one for each N , i.e., θˆ (^) N →P θ.
But usually we’ll suppress this extra notation.) How can we establish that an estimator is consistent? Well, the easiest thing to do is to establish that the estimator is asymptotically unbiased,
B(θ, N ) →N →∞ 0 ,
and that the variance goes to zero,
V (θ, N ) →N →∞ 0;
then we can just apply our bias-variance decomposition and Chebysheff’s inequality, and we’re done. Exercise 83: Use this method to develop a simple consistent estimator of the binomial parameter p. It’s worth noting that it’s possible to come up with examples in which the estimator is consistent but either the bias or the variance does not tend
(^24) HMC p. 206.
to zero; in other words, for consistency it is sufficient but not necessary that the bias and variance both tend to 0. For example, an estimator might have very fat tails, such that the variance is infinite for any N , but nonetheless most of the mass of p(θˆ (^) N ) becomes concentrated around the true θ. I’ll leave it to you to work out the details of such an example.
Method of moments
One way to generate consistent estimators is to find a function U (x) of a single observation Xi such that Eθ (U (x)) = f (θ), where f (θ) is chosen to be a one-to-one function with a continuous inverse. Then we can use our results about convergence in probability of continuous functions to see that the estimator
θˆ (^) M M = f −^1
i=
U (x (^) i )
is consistent for θ. (To see this, note that
i=
U (x (^) i ) →P Eθ U (x) = f (θ),
by the law of large numbers and the definition of f (θ), then apply f −^1 to both sides and use what we’ve learned about continuous mappings and convergence in probability.) In the case of multiple parameters, we would solve this equation simul- taneously for several Uj. When Uj are taken to be the first j moments of
X (i.e., we choose θˆ to match the observed moments to the true moments as a function of θ), this estimation technique is known as the “method of moments.” Here’s an example. Let x (^) i ∼ exp(θ). Now let U (x) = x. Then
Eθ (U (x)) = f (θ) = 1/θ.
Therefore
θˆ (^) M M =
i=
U (x (^) i )
i=
x (^) i
is consistent for θ.