Week 11 — Rao-Blackwell improvement, completeness, and UMVU estimation

Where this week starts

Week 10 handed you a conservation law. For a Bernoulli sample the total T=i=1nXiT = \sum_{i=1}^{n} X_i carries everything about pp that the full list of zeros and ones carries; for Uniform(0,θ0, \theta) the maximum X(n)X_{(n)} does. Once you know TT, whatever remains of the sample is a lottery whose odds do not involve θ\theta. What sufficiency did not do was build anything: it named what may be discarded, not what to compute.

This week converts that law into an operator. Hand it any unbiased estimator, however crude, together with a sufficient statistic, and it returns an unbiased estimator whose variance is no larger — usually much smaller. The recipe is one line: replace the estimator by its conditional expectation given the sufficient statistic, and the proof is Week 0’s variance decomposition used once. The striking part is that the starting estimator may be indefensible: begin with one that ignores eleven of your twelve observations and can only ever report zero or one, and the operator returns the sample mean.

Two questions survive. Does conditioning ever fail to improve, and does the destination depend on where you started? The first has a slightly deflating reply: the improvement is strict unless the estimator you fed in was already a function of the sufficient statistic. The second needs a new idea, completeness, a richness condition on the family of distributions of TT. When it holds, TT carries at most one unbiased estimator, so every crude starting point is funnelled to one destination, which Lehmann-Scheffe promotes to a uniformly minimum variance unbiased estimator — best at every parameter value at once, among all unbiased estimators.

Read that last clause carefully, because the page closes by attacking it. UMVU is optimality inside the unbiased class, and Week 6 already showed that class is not sacred: in two of the three models below, a biased estimator has smaller mean squared error than the UMVU winner. By Thursday you should be able to find a complete sufficient statistic in an unfamiliar one-parameter model, condition any unbiased estimator at all, and say what the result is optimal among — and where that guarantee stops.

Why this matters downstream

A fabrication line reports the fraction of panels expected to leave with no surface flaw. Flaw counts are modelled as Poisson(λ\lambda), so the quantity wanted is eλe^{-\lambda}, and the natural move is to fit λ̂=x\hat\lambda = \bar{x} and report exe^{-\bar{x}}. That estimator is biased upward at every sample size, by an amount depending on nn and λ\lambda that nobody reading the report can see. This week produces the unique unbiased estimator instead, (11/n)T(1 - 1/n)^{T}; on the data below the two differ in the second decimal place, 0.47830.4783 against 0.49660.4966. Which belongs in the report depends on whether you are scored on bias or on squared error — a decision you cannot make without knowing both exist.

The structural stake is Week 12. The Cramer-Rao bound says any unbiased estimator has variance at least 1/(nI1(θ))1/(nI_1(\theta)), and that theorem is only interesting if the unbiased class has a best member to compare the bound against. Lehmann-Scheffe supplies it. When the UMVU variance sits strictly above the bound at every finite nn, as it does for eλe^{-\lambda} below, the bound is not attainable, and hunting for an estimator to attain it is wasted effort.

What you will be able to do

  • Prove the Rao-Blackwell theorem from the variance decomposition and name which hypothesis each step consumes.
  • Compute 𝔼[δ(X)T=t]\mathbb{E}[\delta(X) \mid T = t] in a discrete model by counting arrangements, and in a continuous model by symmetry.
  • Verify completeness for the Bernoulli, Poisson and Uniform(0,θ0, \theta) families by turning the unbiased-estimator-of-zero condition into a statement about polynomials, power series or integrals.
  • Apply Lehmann-Scheffe to certify an estimator as UMVU, and state which class that optimality is relative to.
  • Exhibit a family whose minimal sufficient statistic is not complete, and show uniqueness failing there.
  • Describe a simulation that checks a claimed risk improvement, and say what it can and cannot establish.

Words worth owning

Term What it means in this course
Rao-Blackwellization Replacing δ(X)\delta(X) by 𝔼[δ(X)T]\mathbb{E}[\delta(X) \mid T] for a sufficient TT; bias is preserved, variance cannot rise.
Fibre of TT The set of samples sharing one value of TT, also called a level set; conditioning averages over a fibre.
Complete statistic TT such that 𝔼θ[g(T)]=0\mathbb{E}_\theta[g(T)] = 0 for every θ\theta forces g(T)=0g(T) = 0 with probability one — no nonzero unbiased estimator of zero can be built from TT.
Unbiased estimator of zero A statistic with mean zero for every θ\theta. Completeness says TT admits only the trivial one.
UMVU estimator An unbiased estimator whose variance is smallest among unbiased estimators at every θ\theta simultaneously, not just at one.
Lehmann-Scheffe theorem Complete plus sufficient plus unbiased, and a function of TT, implies UMVU and unique.
Ancillary statistic A statistic whose distribution does not depend on θ\theta at all — the opposite extreme from sufficiency.

Conditioning as an improvement operator

Let X=(X1,,Xn)X = (X_1, \dots, X_n) be the sample, drawn from f(xθ)f(x \mid \theta) with θΘ\theta \in \Theta, and let T=T(X)T = T(X) be sufficient for θ\theta. Let δ(X)\delta(X) be any estimator of a target g(θ)g(\theta) with 𝔼θ[δ(X)2]<\mathbb{E}_\theta[\delta(X)^2] < \infty for every θ\theta. Define the Rao-Blackwellized estimator

η(T)=𝔼[δ(X)T].\eta(T) = \mathbb{E}\left[\delta(X) \mid T\right].

Three claims make up the theorem. First, η\eta is a statistic, so it can actually be computed from data. Second, 𝔼θ[η(T)]=𝔼θ[δ(X)]\mathbb{E}_\theta[\eta(T)] = \mathbb{E}_\theta[\delta(X)] for every θ\theta, so bias — including zero bias — is carried across unchanged. Third,

Varθ{η(T)}Varθ{δ(X)}for every θ,\operatorname{Var}_\theta\{\eta(T)\} \le \operatorname{Var}_\theta\{\delta(X)\} \quad \text{for every } \theta,

with equality at a given θ\theta if and only if δ(X)=η(T)\delta(X) = \eta(T) with PθP_\theta-probability one.

The variance decomposition does the work

The second claim is the tower property: 𝔼θ[𝔼[δT]]=𝔼θ[δ]\mathbb{E}_\theta[\mathbb{E}[\delta \mid T]] = \mathbb{E}_\theta[\delta]. The third is the variance decomposition from Week 0, applied to δ\delta and TT:

Varθ(δ)=𝔼θ[Var(δT)]+Varθ(𝔼[δT])=𝔼θ[Var(δT)]+Varθ{η(T)}.\operatorname{Var}_\theta(\delta) = \mathbb{E}_\theta\left[\operatorname{Var}(\delta \mid T)\right] + \operatorname{Var}_\theta\left(\mathbb{E}[\delta \mid T]\right) = \mathbb{E}_\theta\left[\operatorname{Var}(\delta \mid T)\right] + \operatorname{Var}_\theta\{\eta(T)\}.

The first term on the right is an expectation of a variance, so it is never negative, and rearranging gives the inequality at once. It also gives the exact amount saved: the variance removed is the average within-fibre variance of δ\delta. That term vanishes precisely when δ\delta does not vary within fibres — when δ\delta was already a function of TT — which is the equality condition above.

Because the bias is unchanged and mean squared error splits as squared bias plus variance, the same line upgrades to a risk statement without any extra assumption:

MSEθ{η(T)}=MSEθ{δ(X)}𝔼θ[Var(δT)].\mathrm{MSE}_\theta\{\eta(T)\} = \mathrm{MSE}_\theta\{\delta(X)\} - \mathbb{E}_\theta\left[\operatorname{Var}(\delta \mid T)\right].

So the operator improves biased estimators too; it simply cannot repair their bias. Nor is the improvement special to squared error: for any loss L(a,g(θ))L(a, g(\theta)) convex in its first argument, conditional Jensen gives L(𝔼[δT],g(θ))𝔼[L(δ,g(θ))T]L(\mathbb{E}[\delta \mid T], g(\theta)) \le \mathbb{E}[L(\delta, g(\theta)) \mid T], and taking expectations shows the conditioned estimator has risk no larger. One inequality covers every convex loss.

One reading is worth carrying. Among square-integrable functions of the data, the functions of TT form a closed subspace and 𝔼[T]\mathbb{E}[\cdot \mid T] projects onto it, so the decomposition is Pythagoras: Rao-Blackwell is projection, and projection never lengthens a vector.

Why the statistic has to be sufficient

Notice where sufficiency entered. Not in the inequality — the variance decomposition holds for conditioning on any statistic. It entered in the first claim, that η\eta is a statistic at all. In general 𝔼[δ(X)T=t]\mathbb{E}[\delta(X) \mid T = t] is computed from the conditional distribution of XX given T=tT = t, which normally depends on θ\theta, so the result is a function of tt and θ\theta both and cannot be evaluated from data. Sufficiency is exactly the condition that this conditional law is free of θ\theta.

The failure is easy to see. Take X1,,XnX_1, \dots, X_n independent N(μ,1)N(\mu, 1), take δ=X\delta = \bar{X}, and condition on T=X1T = X_1, which is not sufficient. Independence gives

𝔼[XX1=x1]=x1n+n1nμ,\mathbb{E}[\bar{X} \mid X_1 = x_1] = \frac{x_1}{n} + \frac{n-1}{n}\,\mu,

which contains the unknown μ\mu. It has a smaller variance than X\bar{X} in the formal sense of the decomposition, and it is useless, because you cannot compute it without already knowing what you are estimating. Sufficiency stops the operator from cheating.

Reading the improvement as an average over a fibre

The mechanics are clearest when the sample space is small enough to draw. Take n=4n = 4 independent Bernoulli(pp) trials, so there are sixteen possible samples, and take T=iXiT = \sum_i X_i, sufficient by factorization. The five fibres of TT are the groups of samples sharing a total, and Week 10 verified that, given T=tT = t, the (4t)\binom{4}{t} arrangements of tt ones are equally likely whatever pp is — sufficiency in its most concrete form.

Five rows of chips show all sixteen binary samples of length four grouped by their total; chips whose first entry is one are shaded orange, and each row's average is printed on the right as 0.00, 0.25, 0.50, 0.75 and 1.00.

Every sample of size four, grouped by its total, with the crude estimate averaged inside each group.

Read the figure one row at a time. The crude estimator is δ(X)=X1\delta(X) = X_1, unbiased because 𝔼[X1]=p\mathbb{E}[X_1] = p: orange chips are samples where it reports one, blue chips where it reports zero. In the row t=2t = 2 it reports one on three of the six samples, so its average over that fibre is 0.500.50; the same count gives 1/41/4 at t=1t = 1 and 3/43/4 at t=3t = 3. Every row average is t/4t/4, which is x\bar{x}.

That is the whole theorem in miniature. The conditional distribution is uniform over the arrangements, so the conditional expectation is an unweighted average, and the count of arrangements with a one in the first position is (n1t1)\binom{n-1}{t-1} out of (nt)\binom{n}{t}, giving

𝔼[X1T=t]=(n1t1)(nt)=tn.\mathbb{E}[X_1 \mid T = t] = \frac{\binom{n-1}{t-1}}{\binom{n}{t}} = \frac{t}{n}.

The crude estimator jumps within a row and the improved one is flat on it, so the within-row variation is exactly what the decomposition promised to remove.

Completeness and the uniqueness it buys

Rao-Blackwell improves, but it does not select. Feed it two different unbiased starting estimators and, as far as the theorem is concerned, you may get two different unbiased functions of TT with different variances. Completeness rules that out.

What completeness demands, and how you check it

A statistic TT is complete for the family {Pθ:θΘ}\{P_\theta : \theta \in \Theta\} if, for every function gg with 𝔼θ|g(T)|<\mathbb{E}_\theta \lvert g(T) \rvert < \infty,

𝔼θ[g(T)]=0 for every θΘPθ{g(T)=0}=1 for every θΘ.\mathbb{E}_\theta[g(T)] = 0 \ \text{ for every } \theta \in \Theta \quad \Longrightarrow \quad P_\theta\{g(T) = 0\} = 1 \ \text{ for every } \theta \in \Theta.

In words: the only unbiased estimator of zero you can build out of TT is the zero estimator. The consequence follows in one step. If η1(T)\eta_1(T) and η2(T)\eta_2(T) are both unbiased for the same g(θ)g(\theta), then η1η2\eta_1 - \eta_2 has mean zero for every θ\theta, so completeness forces η1=η2\eta_1 = \eta_2 almost surely: there is at most one unbiased estimator that is a function of TT.

Completeness is a property of the whole family, not of a single distribution, and it needs Θ\Theta rich. Verifying it means turning the displayed condition into an algebraic one. Three verifications to be able to reproduce:

  • Bernoulli. With TBin(n,p)T \sim \mathrm{Bin}(n, p) and r=p/(1p)r = p/(1-p), the condition t=0ng(t)(nt)pt(1p)nt=0\sum_{t=0}^{n} g(t)\binom{n}{t}p^{t}(1-p)^{n-t} = 0 becomes (1p)nt=0ng(t)(nt)rt=0(1-p)^{n}\sum_{t=0}^{n} g(t)\binom{n}{t} r^{t} = 0. As pp runs over (0,1)(0,1), rr runs over (0,)(0, \infty), so a polynomial of degree at most nn vanishes on an interval; all its coefficients are zero; and since (nt)0\binom{n}{t} \ne 0, every g(t)=0g(t) = 0.
  • Poisson. With TPoisson(nλ)T \sim \mathrm{Poisson}(n\lambda), the condition is enλt0g(t)(nλ)t/t!=0e^{-n\lambda}\sum_{t \ge 0} g(t)(n\lambda)^{t}/t! = 0 for all λ>0\lambda > 0. A power series vanishing on an interval has all coefficients zero, so again g0g \equiv 0.
  • Uniform(0,θ0, \theta). Here T=X(n)T = X_{(n)} has density ntn1/θnn t^{n-1}/\theta^{n} on (0,θ)(0, \theta), so the condition reads 0θg(t)tn1dt=0\int_0^{\theta} g(t)\,t^{n-1}\,dt = 0 for every θ>0\theta > 0. Differentiating in θ\theta gives g(θ)θn1=0g(\theta)\theta^{n-1} = 0 for almost every θ>0\theta > 0, hence g=0g = 0 almost everywhere.

The third verification shows that completeness is not the private property of exponential families. Uniform(0,θ0, \theta) is not one — its support moves — and X(n)X_{(n)} is complete all the same.

For exponential families a theorem saves the work. Write the density as f(xψ)=h(x)exp{j=1kψjTj(x)A(ψ)}f(x \mid \psi) = h(x)\exp\{\sum_{j=1}^{k}\psi_j T_j(x) - A(\psi)\}, where ψ=(ψ1,,ψk)\psi = (\psi_1, \dots, \psi_k) is the natural parameter and T1(x),,Tk(x)T_1(x), \dots, T_k(x) are the components of the vector statistic T=(T1,,Tk)T = (T_1, \dots, T_k); η\eta stays reserved for the conditioned estimator above. If the natural parameter space contains an open rectangle in k\mathbb{R}^{k}, then TT is complete as well as sufficient. That open-set requirement does real work. A curved family, in which ψ\psi is confined to a lower-dimensional curve, generally loses completeness: for N(θ,θ2)N(\theta, \theta^{2}) the pair (iXi,iXi2)(\sum_i X_i, \sum_i X_i^{2}) is minimal sufficient but not complete, because the single unknown θ\theta ties the two natural parameters together. Shrinking Θ\Theta does the same — restrict a Bernoulli model to p{1/3,2/3}p \in \{1/3, 2/3\} and completeness becomes two linear equations in n+1n+1 unknowns, which for n2n \ge 2 has a nonzero root.

The Lehmann-Scheffe theorem

Statement. Let TT be complete and sufficient for θ\theta, and let η(T)\eta(T) be an unbiased estimator of g(θ)g(\theta) with finite variance. Then η(T)\eta(T) is UMVU for g(θ)g(\theta), and it is the only UMVU estimator up to almost-sure equality.

Derivation. Let δ(X)\delta(X) be any unbiased estimator of g(θ)g(\theta) with finite variance. Rao-Blackwellize it: ηδ(T)=𝔼[δT]\eta_\delta(T) = \mathbb{E}[\delta \mid T] is unbiased for g(θ)g(\theta) and has variance no larger than δ\delta. Now both η\eta and ηδ\eta_\delta are unbiased functions of TT, so 𝔼θ[η(T)ηδ(T)]=0\mathbb{E}_\theta[\eta(T) - \eta_\delta(T)] = 0 for every θ\theta, and completeness forces η=ηδ\eta = \eta_\delta almost surely. Therefore

Varθ{η(T)}=Varθ{ηδ(T)}Varθ{δ(X)}for every θ,\operatorname{Var}_\theta\{\eta(T)\} = \operatorname{Var}_\theta\{\eta_\delta(T)\} \le \operatorname{Var}_\theta\{\delta(X)\} \quad \text{for every } \theta,

and since δ\delta was arbitrary, η\eta is UMVU. For uniqueness, suppose δ\delta is unbiased with Varθ(δ)=Varθ(η)\operatorname{Var}_\theta(\delta) = \operatorname{Var}_\theta(\eta) for all θ\theta. Then the Rao-Blackwell inequality holds with equality, so δ=𝔼[δT]=η\delta = \mathbb{E}[\delta \mid T] = \eta almost surely.

Nested regions: all finite-variance estimators, then the unbiased ones, then the unbiased functions of T as a point marked UMVU at variance 0.0179. Two crude estimators arrow into it; a biased one sits outside at MSE 0.0176.

The unbiased class, the single point completeness collapses it to, and a biased rival outside it.

The figure is the theorem’s geography for the Poisson example below. Two crude unbiased estimators sit in the outer band, variances 0.25000.2500 and 0.02500.0250; both arrows land on the same point, because the inner region has one member. So two recipes are interchangeable: guess an unbiased function of TT and stop, or start anywhere unbiased and condition. Guessing is faster; conditioning always works. The green point outside the unbiased region is what students forget — a biased estimator with mean squared error 0.01760.0176 against the winner’s 0.01790.0179, simply outside the competition.

Note

A second dividend of completeness — Basu’s theorem. If TT is complete sufficient and AA is ancillary, meaning its distribution does not depend on θ\theta, then TT and AA are independent. In N(μ,σ2)N(\mu, \sigma^{2}) with σ2\sigma^{2} known, X\bar{X} is complete sufficient for μ\mu and the distribution of S2S^{2} is free of μ\mu, so the two are independent — Week 4’s least obvious fact, with no orthogonal transformation.

An incomplete family, where uniqueness fails

Let X1,,XnX_1, \dots, X_n be independent and uniform on (θ,θ+1)(\theta, \theta + 1), with θ\theta \in \mathbb{R} unknown — known width, unknown position. Factorization gives the minimal sufficient statistic T=(X(1),X(n))T = (X_{(1)}, X_{(n)}), two-dimensional for a one-dimensional parameter, which is the warning sign. Put Yi=XiθY_i = X_i - \theta, so the YiY_i are uniform on (0,1)(0,1) and the range R=X(n)X(1)=Y(n)Y(1)R = X_{(n)} - X_{(1)} = Y_{(n)} - Y_{(1)} has a distribution free of θ\theta. Since 𝔼[Y(n)]=n/(n+1)\mathbb{E}[Y_{(n)}] = n/(n+1) and 𝔼[Y(1)]=1/(n+1)\mathbb{E}[Y_{(1)}] = 1/(n+1),

𝔼θ[Rn1n+1]=0for every θ,\mathbb{E}_\theta\left[R - \frac{n-1}{n+1}\right] = 0 \quad \text{for every } \theta,

and RR is a continuous random variable, so this statistic is not zero. That is a nonzero unbiased estimator of zero built from TT: the family is not complete.

Uniqueness dies with it. Both θ̂1=X(1)1n+1\hat\theta_1 = X_{(1)} - \frac{1}{n+1} and θ̂2=X(n)nn+1\hat\theta_2 = X_{(n)} - \frac{n}{n+1} are unbiased functions of the minimal sufficient statistic, and each equals its own Rao-Blackwellization, so conditioning returns whichever one you fed in. Their variances are equal, both n/{(n+1)2(n+2)}n/\{(n+1)^{2}(n+2)\}, but the midrange-based θ̂3=12(X(1)+X(n))12\hat\theta_3 = \frac{1}{2}(X_{(1)} + X_{(n)}) - \frac{1}{2} is also unbiased and, using Cov(Y(1),Y(n))=1/{(n+1)2(n+2)}\operatorname{Cov}(Y_{(1)}, Y_{(n)}) = 1/\{(n+1)^{2}(n+2)\}, has variance

Var(θ̂3)=142n+2(n+1)2(n+2)=12(n+1)(n+2).\operatorname{Var}(\hat\theta_3) = \frac{1}{4}\cdot\frac{2n + 2}{(n+1)^{2}(n+2)} = \frac{1}{2(n+1)(n+2)}.

At n=5n = 5 that is 1/84=0.01191/84 = 0.0119 against 5/252=0.01985/252 = 0.0198 for either endpoint estimator, a ratio of 5/35/3. Three unbiased functions of the minimal sufficient statistic, two distinct variances, and no theorem to pick between them: Lehmann-Scheffe is silent, and Rao-Blackwell has no purchase because there is nothing left to condition away. The midrange wins this comparison, but nothing certifies it as UMVU — with completeness gone, a smaller variance is a fact about three estimators, not a theorem about all of them.

Checking the improvement by simulation

A variance formula is a claim, and this course audits claims. Simulation is the third of Week 8’s four checks, and it is easy here because both estimators are computed from the same samples. Below is the Poisson comparison of the second worked example, at n=10n = 10 and λ=0.7\lambda = 0.7.

set.seed(11)
n      <- 10
lam    <- 0.7
reps   <- 200000
target <- exp(-lam)                      # 0.4965853, the quantity being estimated

x   <- matrix(rpois(reps * n, lam), nrow = reps)
tot <- rowSums(x)

crude <- as.numeric(x[, 1] == 0)         # unbiased, but it reads only the first panel
umvu  <- (1 - 1 / n)^tot                 # the Rao-Blackwellized estimator
plug  <- exp(-tot / n)                   # the maximum likelihood plug-in

c(mean(crude), mean(umvu), mean(plug))   # about 0.497, 0.497, 0.514
c(mean((crude - target)^2),              # about 0.2500
  mean((umvu  - target)^2),              # about 0.0179
  mean((plug  - target)^2))              # about 0.0176

# the last two are computed on the same samples, so difference them pairwise
d <- (umvu - target)^2 - (plug - target)^2
c(mean(d), sd(d) / sqrt(reps))           # about 0.00032, with standard error 0.00001

# for contrast, the standard error of the same gap read off two unpaired averages
sqrt(var((umvu - target)^2) / reps +
     var((plug - target)^2) / reps)      # about 0.00008, nine times larger

Three things in that output deserve comment. The first two means agree with e0.7e^{-0.7} to within Monte Carlo error, as unbiasedness predicts, while the third sits about 0.0170.017 high — the bias of the plug-in, visible without algebra. The mean squared errors reproduce the analytic values derived below. And pairing is the honest way to compare two estimators evaluated on the same data: differencing removes the shared noise, so the gap of 0.000320.00032 carries a standard error of 0.000010.00001 instead of the 0.000080.00008 it would carry read off the two averages separately. Both clear the noise here, at four unpaired standard errors against thirty-six paired; but pairing resolves the gap nine times more sharply for free, and at a tenth of the replications only the paired comparison would see it.

Two panels plot variance against n from 1 to 30. Each shows a dashed flat line for the crude estimator and a falling curve for the improved one, meeting at n equals 1; the Poisson panel adds a dashed information floor below.

Variance against sample size for the crude and improved estimators in two models.

The flat lines are the crude estimators, which read a single observation and never improve; the falling curves are their conditioned versions. On the left, the Bernoulli variance at p=1/3p = 1/3 falls as exactly 0.2222/n0.2222/n, so the improvement factor is precisely nn. On the right, for the Poisson estimand eλe^{-\lambda} at λ=0.7\lambda = 0.7, the improved variance falls at close to the same rate, and the lower dashed curve is the Cramer-Rao floor of Week 12. The floor is never touched, though the gap closes as nn grows: at n=10n = 10 the variance is 0.017880.01788 against a floor of 0.017260.01726, short by 3.63.6 percent. At n=1n = 1 the improved curve meets the flat line at 0.25000.2500, because with a single observation the improved estimator is the crude one — a coincidence that costs nothing to check and would catch an algebra slip. The floor joins neither of them there: at n=1n = 1 it is λe2λ=0.1726\lambda e^{-2\lambda} = 0.1726, strictly below both.

Simulation cannot prove any of this. It agrees with the derivation at one parameter value and one sample size, in the presence of noise — evidence, not proof, and Week 8’s caution applies. What it catches reliably is a sign error, a dropped factor of nn, or a conditional distribution identified wrongly, all of which move the numbers far outside Monte Carlo error.

Worked example — from one Bernoulli trial to the sample mean

Setting. A laboratory pressure-tests n=12n = 12 independently manufactured seals. Each either leaks or does not, and the recorded sequence is

0,1,0,0,1,0,1,0,0,0,1,0,0,\ 1,\ 0,\ 0,\ 1,\ 0,\ 1,\ 0,\ 0,\ 0,\ 1,\ 0,

with 11 denoting a leak. Model these as independent Bernoulli(pp), so f(xp)=px(1p)1xf(x \mid p) = p^{x}(1-p)^{1-x} for x{0,1}x \in \{0,1\} and 0<p<10 < p < 1, and let the estimand be pp itself. The total is t=ixi=4t = \sum_i x_i = 4, and the first observation is x1=0x_1 = 0.

Step one — a deliberately bad unbiased estimator. Take δ(X)=X1\delta(X) = X_1. It is unbiased, since 𝔼p[X1]=p\mathbb{E}_p[X_1] = p, and indefensible: it discards eleven observations and reports p̂=0\hat p = 0 here, a value the four recorded leaks refute. Its variance is Varp(X1)=p(1p)\operatorname{Var}_p(X_1) = p(1-p), which never shrinks with nn, since it never reads the extra data.

Step two — the sufficient statistic. The joint mass function is pt(1p)ntp^{t}(1-p)^{n-t} with t=ixit = \sum_i x_i, which factors as g(tp)h(x)g(t \mid p) \cdot h(x) with h1h \equiv 1, so T=iXiT = \sum_i X_i is sufficient by Week 10’s criterion. Here TBin(n,p)T \sim \mathrm{Bin}(n, p).

Step three — condition. Two routes to the same conditional expectation. By counting, as in the fibre figure, 𝔼[X1T=t]=(n1t1)/(nt)=t/n\mathbb{E}[X_1 \mid T = t] = \binom{n-1}{t-1}/\binom{n}{t} = t/n. By symmetry, the XiX_i are exchangeable, so 𝔼[XiT]\mathbb{E}[X_i \mid T] is the same for every ii, while i=1n𝔼[XiT]=𝔼[TT]=T\sum_{i=1}^{n}\mathbb{E}[X_i \mid T] = \mathbb{E}[T \mid T] = T; dividing by nn gives 𝔼[X1T]=T/n\mathbb{E}[X_1 \mid T] = T/n. The Rao-Blackwellized estimator is therefore

η(T)=Tn=X,η(4)=412=0.3333.\eta(T) = \frac{T}{n} = \bar{X}, \qquad \eta(4) = \frac{4}{12} = 0.3333.

Step four — the variances. Varp(X)=p(1p)/n\operatorname{Var}_p(\bar{X}) = p(1-p)/n, so the variance has been divided by exactly n=12n = 12. At p=1/3p = 1/3 the crude estimator has variance 0.22220.2222 and standard deviation 0.47140.4714; the improved one has variance 0.018520.01852 and standard deviation 0.13610.1361.

Step five — audit the decomposition. The theorem says the saving equals 𝔼p[Var(X1T)]\mathbb{E}_p[\operatorname{Var}(X_1 \mid T)]. Given T=tT = t the variable X1X_1 is Bernoulli(t/nt/n), so Var(X1T)=Tn(1Tn)=X(1X)\operatorname{Var}(X_1 \mid T) = \frac{T}{n}\left(1 - \frac{T}{n}\right) = \bar{X}(1 - \bar{X}), and

𝔼p[X(1X)]=p{Varp(X)+p2}=p(1p)p(1p)n=p(1p)n1n.\mathbb{E}_p\left[\bar{X}(1-\bar{X})\right] = p - \left\{\operatorname{Var}_p(\bar{X}) + p^{2}\right\} = p(1-p) - \frac{p(1-p)}{n} = p(1-p)\,\frac{n-1}{n}.

Adding the improved variance p(1p)/np(1-p)/n returns p(1p)p(1-p), which is Varp(X1)\operatorname{Var}_p(X_1) exactly. At p=1/3p = 1/3 and n=12n = 12 that reads 0.20370+0.01852=0.222220.20370 + 0.01852 = 0.22222. The decomposition closes, so no factor of nn has gone missing.

Top panel: two bars at 0 and 1 with heights 0.667 and 0.333, standard deviation 0.471. Bottom panel: thirteen much shorter bars concentrated near 0.333, standard deviation 0.136. A dashed red line at p equals 0.333 runs through both.

Sampling distributions of the crude estimator and the improved one, on one shared axis.

Both distributions are centred at p=1/3p = 1/3 — the red line runs through the balance point of each — which is why unbiasedness alone cannot rank them. The top panel can only ever report 00 or 11; the bottom sits within ±0.14\pm 0.14 of the truth.

Step six — certify it. The binomial family is complete, TT is sufficient, and X\bar{X} is an unbiased function of TT, so Lehmann-Scheffe makes X\bar{X} the unique UMVU estimator of pp. Week 12’s bound is p(1p)/np(1-p)/n here, which X\bar{X} attains exactly, so the unbiased class has a best member sitting on the information floor.

Step seven — critique. The certificate has two limits. It covers the unbiased class only: p̃=(T+1)/(n+2)\tilde p = (T+1)/(n+2) — Week 9’s beta-binomial posterior mean at the uniform Beta(1,1) prior — is biased, and at p=1/3p = 1/3 with n=12n = 12 its bias is 5/141/3=0.023815/14 - 1/3 = 0.02381 and its variance Var(T)/142=2.6667/196=0.01361\operatorname{Var}(T)/14^{2} = 2.6667/196 = 0.01361, for a mean squared error of 0.014170.01417 against the UMVU’s 0.018520.01852. Best unbiased did not make X\bar{X} best. And it is conditional on the model: independence and a common pp across seals. If seals came in batches with batch-to-batch variation in pp, TT would no longer be sufficient for anything scientifically interesting, and reducing twelve numbers to one would discard the batch structure a diagnostic needs.

The same reasoning, transferred

Run the identical four moves in a model with nothing exponential about it. A sensor’s output is uniform on (0,θ)(0, \theta) and six independent readings, in volts, are 0.350.35, 0.420.42, 0.880.88, 1.171.17, 1.511.51 and 1.941.94, so n=6n = 6 and x(n)=1.94x_{(n)} = 1.94.

Start crude. Since 𝔼[X1]=θ/2\mathbb{E}[X_1] = \theta/2, the estimator δ=2X1\delta = 2X_1 is unbiased for θ\theta, with Var(2X1)=4θ2/12=θ2/3\operatorname{Var}(2X_1) = 4\theta^{2}/12 = \theta^{2}/3. Here it reports 2(0.35)=0.702(0.35) = 0.70 volts, a ceiling below a reading already in the notebook — the refuted-estimate failure Week 7 flagged for 2X2\bar{X}.

Condition on T=X(n)T = X_{(n)}, sufficient by factorization with an indicator. Given X(n)=tX_{(n)} = t, exchangeability makes each index equally likely to achieve the maximum, and given that it is not index one, X1X_1 is uniform on (0,t)(0, t). Hence

𝔼[X1X(n)=t]=1nt+n1nt2=(n+1)t2n,η(T)=2𝔼[X1T]=n+1nX(n).\mathbb{E}[X_1 \mid X_{(n)} = t] = \frac{1}{n}\,t + \frac{n-1}{n}\cdot\frac{t}{2} = \frac{(n+1)\,t}{2n}, \qquad \eta(T) = 2\,\mathbb{E}[X_1 \mid T] = \frac{n+1}{n}X_{(n)}.

Here η=76(1.94)=2.2633\eta = \frac{7}{6}(1.94) = 2.2633 volts. Certify it: X(n)X_{(n)} is complete, shown above by differentiating the integral, so Lehmann-Scheffe makes n+1nX(n)\frac{n+1}{n}X_{(n)} the UMVU estimator of θ\theta — precisely the bias-corrected estimator Week 6 produced by hand, now with a reason rather than a repair.

What stayed the same: a crude unbiased estimator reading one observation; a complete sufficient statistic; a conditional expectation from symmetry, not integration; a certificate from the same theorem. What changed is the size of the prize. Using Var{X(n)}=nθ2/{(n+2)(n+1)2}\operatorname{Var}\{X_{(n)}\} = n\theta^{2}/\{(n+2)(n+1)^{2}\} from Week 7,

Var{n+1nX(n)}=(n+1)2n2nθ2(n+2)(n+1)2=θ2n(n+2),\operatorname{Var}\left\{\frac{n+1}{n}X_{(n)}\right\} = \frac{(n+1)^{2}}{n^{2}}\cdot\frac{n\theta^{2}}{(n+2)(n+1)^{2}} = \frac{\theta^{2}}{n(n+2)},

which at n=6n = 6 is θ2/48\theta^{2}/48 against θ2/3\theta^{2}/3: an improvement factor of n(n+2)/3=16n(n+2)/3 = 16, not n=6n = 6. The extra gain is the n2n^{-2} convergence rate of a sample maximum, the same irregularity that makes Week 12’s information bound inapplicable here.

Second worked example — the probability of a clean panel in a Poisson model

Setting. A fabrication line inspects n=10n = 10 finished panels and records surface flaws per panel:

0,2,1,0,0,1,0,3,0,0.0,\ 2,\ 1,\ 0,\ 0,\ 1,\ 0,\ 3,\ 0,\ 0.

Model the counts as independent Poisson(λ\lambda) with λ>0\lambda > 0. The total is t=ixi=7t = \sum_i x_i = 7, so x=0.7\bar{x} = 0.7, and six of the ten panels are clean. The estimand is not λ\lambda but

ϑ=λ(X=0)=eλ,\vartheta = \mathbb{P}_\lambda(X = 0) = e^{-\lambda},

the probability that a panel leaves with no flaw. This example strains a different joint from the first: the target is a nonlinear function of the parameter, and the obvious estimator is not the right one.

Step one — three candidates before any theory. The plug-in maximum likelihood estimate is ex=e0.7=0.4966e^{-\bar{x}} = e^{-0.7} = 0.4966, correct by Week 7’s invariance property. The observed fraction of clean panels is 6/10=0.66/10 = 0.6. A third emerges below. They disagree, so something has to choose.

Step two — a crude unbiased estimator. Take δ(X)=𝟏{X1=0}\delta(X) = \mathbf{1}\{X_1 = 0\}, which is 11 when the first panel is clean. It is unbiased, since 𝔼λ[δ]=(X1=0)=eλ\mathbb{E}_\lambda[\delta] = \mathbb{P}(X_1 = 0) = e^{-\lambda}, and here it reports ϑ̂=1\hat\vartheta = 1 — a probability of one, from a data set with four flawed panels in it. At λ=0.7\lambda = 0.7 its variance is ϑ(1ϑ)=0.2500\vartheta(1-\vartheta) = 0.2500.

Step three — the complete sufficient statistic. The joint mass function is enλλt/ixi!e^{-n\lambda}\lambda^{t}/\prod_i x_i!, which factors with g(tλ)=enλλtg(t \mid \lambda) = e^{-n\lambda}\lambda^{t}, so T=iXiT = \sum_i X_i is sufficient; and TPoisson(nλ)T \sim \mathrm{Poisson}(n\lambda), whose family was verified complete above.

Step four — the conditional distribution. For 0kt0 \le k \le t, independence and the fact that i2XiPoisson{(n1)λ}\sum_{i \ge 2} X_i \sim \mathrm{Poisson}\{(n-1)\lambda\} give

(X1=kT=t)=eλλkk!e(n1)λ{(n1)λ}tk(tk)!enλ(nλ)tt!=(tk)(1n)k(11n)tk.\mathbb{P}(X_1 = k \mid T = t) = \frac{e^{-\lambda}\dfrac{\lambda^{k}}{k!}\cdot e^{-(n-1)\lambda}\dfrac{\{(n-1)\lambda\}^{t-k}}{(t-k)!}}{e^{-n\lambda}\dfrac{(n\lambda)^{t}}{t!}} = \binom{t}{k}\left(\frac{1}{n}\right)^{k}\left(1 - \frac{1}{n}\right)^{t-k}.

Every λ\lambda has cancelled, as sufficiency promised: X1T=tX_1 \mid T = t is Binomial(tt, 1/n1/n), which is intuitive — the tt flaws scatter independently and uniformly across the nn panels.

Step five — the improved estimator. Setting k=0k = 0,

η(T)=(X1=0T)=(11n)T,η(7)=(0.9)7=0.4783.\eta(T) = \mathbb{P}(X_1 = 0 \mid T) = \left(1 - \frac{1}{n}\right)^{T}, \qquad \eta(7) = (0.9)^{7} = 0.4783.

By Lehmann-Scheffe this is the UMVU estimator of eλe^{-\lambda}, and the unique unbiased function of TT. Uniqueness is worth testing rather than trusting. The sample fraction of clean panels, 1ni𝟏{Xi=0}\frac{1}{n}\sum_i \mathbf{1}\{X_i = 0\}, is also unbiased and is not a function of TT; conditioning term by term and using exchangeability gives 1nn(11/n)T\frac{1}{n}\cdot n\,(1 - 1/n)^{T} again. Two starting points, one destination.

Step six — check unbiasedness independently. Do not take the conditional argument on trust; sum the series. With TPoisson(nλ)T \sim \mathrm{Poisson}(n\lambda) and any constant cc, 𝔼[cT]=enλt0(cnλ)t/t!=enλ(1c)\mathbb{E}[c^{T}] = e^{-n\lambda}\sum_{t \ge 0}(cn\lambda)^{t}/t! = e^{-n\lambda(1-c)}. Putting c=11/nc = 1 - 1/n gives nλ(1c)=λn\lambda(1-c) = \lambda, so 𝔼[η(T)]=eλ\mathbb{E}[\eta(T)] = e^{-\lambda} for every λ\lambda and nn. A second check costs nothing: at n=1n = 1 the estimator is 0T=𝟏{T=0}0^{T} = \mathbf{1}\{T = 0\}, the crude estimator, as it must be with nothing to average over.

Step seven — the variance, and the floor beneath it. Using the same identity with c=(11/n)2c = (1-1/n)^{2}, so that n(1c)=21/nn(1-c) = 2 - 1/n,

Varλ{η(T)}=eλ(21/n)e2λ=e2λ(eλ/n1).\operatorname{Var}_\lambda\{\eta(T)\} = e^{-\lambda(2 - 1/n)} - e^{-2\lambda} = e^{-2\lambda}\left(e^{\lambda/n} - 1\right).

At λ=0.7\lambda = 0.7 and n=10n = 10 this is 0.2466×0.07251=0.017880.2466 \times 0.07251 = 0.01788, against the crude estimator’s 0.25000.2500 — a reduction by a factor of about 1414. Week 12’s bound for a smooth gg is {g(λ)}2/{nI1(λ)}\{g'(\lambda)\}^{2}/\{nI_1(\lambda)\}; with g(λ)=eλg(\lambda) = e^{-\lambda} and I1(λ)=1/λI_1(\lambda) = 1/\lambda, that floor is λe2λ/n=0.01726\lambda e^{-2\lambda}/n = 0.01726. Since eu1>ue^{u} - 1 > u for every u>0u > 0, the UMVU variance exceeds the floor at every finite nn, by an excess of order n2n^{-2}. And since the UMVU estimator is the best unbiased one, no unbiased estimator attains that bound at any nn — a useful negative result, free.

Step eight — and the biased rival wins anyway. Return to the plug-in eXe^{-\bar{X}}. Using 𝔼[cT]=enλ(1c)\mathbb{E}[c^{T}] = e^{-n\lambda(1-c)} with c=e1/nc = e^{-1/n},

𝔼λ[eX]=enλ(1e1/n)>eλ,\mathbb{E}_\lambda\left[e^{-\bar{X}}\right] = e^{-n\lambda\left(1 - e^{-1/n}\right)} > e^{-\lambda},

because 1e1/n<1/n1 - e^{-1/n} < 1/n. At λ=0.7\lambda = 0.7, n=10n = 10 the mean is 0.513690.51369, so the bias is +0.01710+0.01710; the same identity at c=e2/nc = e^{-2/n} gives a variance of 0.017270.01727 and a mean squared error of 0.01727+0.017102=0.017560.01727 + 0.01710^{2} = 0.01756, against the UMVU estimator’s 0.017880.01788, which is just its variance. The biased plug-in wins by about two percent at this λ\lambda.

Step nine — critique. So which goes in the report? If the panels feed a downstream calculation where biases accumulate across many lines, unbiasedness is worth paying for and 0.47830.4783 is the number. If the loss really is squared error at one line, the plug-in is defensible and 0.49660.4966 is. Reporting one while believing the properties of the other is what is not defensible. Everything here assumed a single Poisson rate; overdispersion, the usual reality in flaw counts, leaves TT sufficient for the wrong model, and eλe^{-\lambda} stops being the clean-panel probability.

The misreading to avoid

“Rao-Blackwell always gives the best estimator, so just condition and stop.” This is the week’s standard error, and it is really four errors wearing one coat.

Best among what? The theorem ranks estimators by variance inside the unbiased class, and only completeness makes that ranking total. Without it the guarantee evaporates: in the Uniform(θ,θ+1\theta, \theta+1) model, all three unbiased functions of the minimal sufficient statistic equal their own Rao-Blackwellization, and no theorem ranks them. Rao-Blackwell there hands back whatever you put in.

Improvement relative to what? The operator improves on the estimator you started with, not on all estimators, and without a sufficient conditioning statistic it does not return a statistic at all: conditioning X\bar{X} on X1X_1 gave x1/n+(n1)μ/nx_1/n + (n-1)\mu/n, containing the unknown parameter. That is not a worse estimator; it is not an estimator.

Best unbiased is not best. Even with completeness in hand, the winner can be beaten on mean squared error by something biased. This page has two instances with the arithmetic done: (T+1)/(n+2)(T+1)/(n+2) against X\bar{X}, 0.014170.01417 against 0.018520.01852; and eXe^{-\bar{X}} against (11/n)T(1-1/n)^{T}, 0.017560.01756 against 0.017880.01788. Week 6’s uniform comparison was a third. Stein’s phenomenon is the famous instance — in three or more dimensions the obvious unbiased estimator of a normal mean vector is inadmissible under total squared error — and the pattern is the same throughout: a little bias buys a lot of variance.

Unbiased is not the same as sensible. The sharpest illustration is one observation from Poisson(λ\lambda) with estimand e2λe^{-2\lambda}. Here T=X1T = X_1 is complete sufficient, and 𝔼[(1)X]=eλk0(λ)k/k!=e2λ\mathbb{E}[(-1)^{X}] = e^{-\lambda}\sum_{k \ge 0}(-\lambda)^{k}/k! = e^{-2\lambda}, so (1)X1(-1)^{X_1} is unbiased and, as the unique unbiased function of a complete sufficient statistic, is UMVU. It estimates a number between zero and one by +1+1 on even counts and 1-1 on odd ones. The theorem is correct and the estimator ridiculous, which tells you what the theorem promises.

Two smaller confusions travel with it. Conditioning does not always strictly reduce variance: if δ\delta is already a function of TT, then Var(δT)=0\operatorname{Var}(\delta \mid T) = 0 and nothing happens. And UMVU is not maximum likelihood relabelled. They coincide in the Bernoulli example, a coincidence of a linear estimand; in the Poisson example (11/n)T(1-1/n)^{T} and eXe^{-\bar{X}} differ, and the invariance that makes maximum likelihood portable is what destroys unbiasedness under a nonlinear gg.

Practice on your own

These are for self-checking, not submission. Work them with a pencil before running anything.

  1. A quadratic estimand. For an independent Bernoulli(pp) sample, start from δ=X1X2\delta = X_1 X_2, unbiased for p2p^{2}, and condition on T=iXiT = \sum_i X_i to obtain T(T1)/{n(n1)}T(T-1)/\{n(n-1)\}. Verify unbiasedness from 𝔼[T(T1)]\mathbb{E}[T(T-1)], certify it with Lehmann-Scheffe, and explain in one sentence why X2\bar{X}^{2} is not unbiased for p2p^{2}.
  2. One more Poisson target. Estimate (X=1)=λeλ\mathbb{P}(X = 1) = \lambda e^{-\lambda} from an independent Poisson sample. Begin from 𝟏{X1=1}\mathbf{1}\{X_1 = 1\}, use the Binomial(tt, 1/n1/n) conditional law from the second worked example, and reach Tn(11n)T1\frac{T}{n}\left(1 - \frac{1}{n}\right)^{T-1}. Check unbiasedness by summing the series, and evaluate it at n=10n = 10, t=7t = 7.
  3. A counterexample hunt. In the Uniform(θ\theta, θ+1\theta+1) model, show that Rn1n+1R - \frac{n-1}{n+1} has mean zero for every θ\theta, then find a fourth unbiased estimator of θ\theta built from (X(1),X(n))(X_{(1)}, X_{(n)}) whose variance differs from both values in the text. Say what feature of the model produced a two-dimensional minimal sufficient statistic for one parameter.
  4. Audit two plausible arguments. (a) “For Uniform(0,θ0,\theta), X(n)X_{(n)} is complete and sufficient and it is also the maximum likelihood estimator, so it is UMVU for θ\theta.” (b) “For the same model, 2X2\bar{X} is unbiased for θ\theta and X(n)X_{(n)} is complete sufficient, so by Lehmann-Scheffe 2X2\bar{X} is UMVU.” Each fails on one hypothesis. Name it in each case, and repair the second by conditioning.
  5. A simulation to describe. Check the uniform transfer above: draw many samples of size n=6n = 6 from Uniform(0,10, 1), compute 2X12X_1 and 76X(6)\frac{7}{6}X_{(6)} on each, and compare the two sample means with 11 and the two sample variances with 1/31/3 and 1/481/48. State in advance what you expect of each, then say what you would conclude if the means matched but the variance ratio came out near 66.

Where to read more

Where this goes next

Week 12 asks the question this page kept deferring: is there a floor under the variance of an unbiased estimator, and does maximum likelihood reach it? The Cramer-Rao bound supplies the floor, Lehmann-Scheffe the best unbiased estimator to compare it against; together they settle whether the bound is attainable. You have seen both outcomes — X\bar{X} sits exactly on the floor in the Bernoulli model, (11/n)T(1-1/n)^{T} stays strictly above it at every finite nn — and the uniform transfer previews the third case, where regularity fails and the bound does not apply. Read Week 12 with those three examples in hand, and revisit Week 10 if any factorization step went past quickly.

Two threads run out of this week. The Bayesian one is quiet but complete: a posterior depends on the data only through a sufficient statistic, so a posterior mean is already a function of TT and can never be improved by Rao-Blackwellization — the repair this page performs is one a Bayes estimator never needs, and the (T+1)/(n+2)(T+1)/(n+2) of step seven is the same observation from the other side. The computational thread: replacing a simulated quantity by a conditional expectation available in closed form is standard Monte Carlo practice, called Rao-Blackwellization for exactly the reason derived above. The notes index has the full sequence.