Calibrating Interval Estimates with Binary Observations

Sampling and Calibration Review

A Polling Nightmare

Before the Election

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800

Your Sample

\[ \begin{array}{r|rrrr|r} i & 1 & 2 & \dots & 625 & \bar{Y}_{625} \\ Y_i & 1 & 1 & \dots & 0 & 0.72 \\ \end{array} \]

The Population

\[ \color{lightgray} \begin{array}{r|rrrrrr|r} j & 1 & 2 & 3 & 4 & \dots & 7.23M & \bar{y}_{7.23M} \\ y_{j} & 1 & 1 & 1 & 0 & \dots & 1 & 0.70 \\ \end{array} \]

  • You want to estimate the proportion of all registered voters — the population — who will vote.
  • To do this, you use the proportion of polled voters — your sample — who said they would.
    • You’re probably not going to match the population proportion exactly …
    • … so you report an interval estimate—a range of values we claim the population proportion is in.
    • You’re know you’re not going to be right 100% of the time you make with claims like this …
    • … so you state a nominal coverage probability—how often you’re right about claims like this.1
  • Without thinking too hard about it, you …
    • … report, as your interval, your sample proportion (72%) ± 1%. Because it sounds good.
    • … and say your coverage probability is 95%. Because that’s what everybody else says.

After the Election

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800

Your Sample

\[ \begin{array}{r|rrrr|r} i & 1 & 2 & \dots & 625 & \bar{Y}_{625} \\ Y_i & 1 & 1 & \dots & 0 & 0.72 \\ \end{array} \]

The Population

\[ \begin{array}{r|rrrrrr|r} j & 1 & 2 & 3 & 4 & \dots & 7.23M & \bar{y}_{7.23M} \\ y_{j} & 1 & 1 & 1 & 0 & \dots & 1 & 0.70 \\ \end{array} \]

  • When the election occurs, we get to see who turns out to vote.
    • 5.05M people, or roughly 70% of registered voters, actually vote.
    • You — and future employers — can see how well you did. And how well everybody else did.
  • Your interval missed the target. It doesn’t contain the turnout proportion.
    • Your point estimate is only off by 2%. But you overstated your precision.
    • Now you’re kicking yourself. You’d briefly considered saying ± 3% or ± 4%.
    • That would’ve done it. But that didn’t sound as good, so you went for ± 1%.
  • You hope you’re not the only one who missed. So you check out the competition.

The Competition

\[ \begin{array}{r|rr|rr|r|rr|r} \text{call} & 1 & & 2 & & \dots & 625 & & \\ \text{poll} & J_1 & Y_1 & J_2 & Y_2 & \dots & J_{625} & Y_{625} & \overline{Y}_{625} \\ \hline \color[RGB]{7,59,76}1 & \color[RGB]{7,59,76}869369 & \color[RGB]{7,59,76}1 & \color[RGB]{7,59,76}4428455 & \color[RGB]{7,59,76}1 & \color[RGB]{7,59,76}\dots & \color[RGB]{7,59,76}1268868 & \color[RGB]{7,59,76}1 & \color[RGB]{7,59,76}0.68 \\ \color[RGB]{239,71,111}2 & \color[RGB]{239,71,111}600481 & \color[RGB]{239,71,111}0 & \color[RGB]{239,71,111}6793745 & \color[RGB]{239,71,111}1 & \color[RGB]{239,71,111}\dots & \color[RGB]{239,71,111}1377933 & \color[RGB]{239,71,111}1 & \color[RGB]{239,71,111}0.71 \\ \color[RGB]{17,138,178}3 & \color[RGB]{17,138,178}3830847 & \color[RGB]{17,138,178}1 & \color[RGB]{17,138,178}5887416 & \color[RGB]{17,138,178}1 & \color[RGB]{17,138,178}\dots & \color[RGB]{17,138,178}4706637 & \color[RGB]{17,138,178}1 & \color[RGB]{17,138,178}0.70 \\ {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} \\ \color[RGB]{6,214,160}1M & \color[RGB]{6,214,160}1487507 & \color[RGB]{6,214,160}1 & \color[RGB]{6,214,160}393580 & \color[RGB]{6,214,160}1 & \color[RGB]{6,214,160}\dots & \color[RGB]{6,214,160}1247545 & \color[RGB]{6,214,160}0 & \color[RGB]{6,214,160}0.72 \\ {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} & {\vdots} \\ \end{array} \]

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800

  • It turns out that everyone got their point estimate exactly like you did.
    • Each of them rolled their 7.23M-sided die 625 times.
    • And after making their 625 calls, they reported their sample proportion.
  • You’re not the only one who missed, but you’re part of a pretty small club.
    • 5% of the other polls got it wrong.
  • But you are the only one who claimed they’d get within 1%.
    • Everyone else said claimed they’d get within roughly 4%.
    • Most were right. About 95%. And a lot of them had worse point estimates than you.
  • What you have is a calibration problem.

Calibration using the Sampling Distribution

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800

  • You’d have seen that your interval was miscalibrated if you knew what you do now.
    1. Your competitors’ point estimates, which they got exactly like you got yours.
    2. Who actually turned out, so you could simulate even more polls if you wanted to.
  • You’d have drawn ± 1% intervals around all these point estimates.2
    • And noticed that many but not most of these intervals cover the target. About 43% do.
    • Or, if leaving the target out of it, that only 43% of them cover the mean of all these estimates.
    • Same thing. The mean and target are right on top of one another. Like this: |.
  • And you’d have known how to choose the right interval width. One that makes 95% of these intervals cover. Right?

Question

0.000 0.005 0.010 0.015 0.020 0.025 0.68 0.72 0.76

  • I’ve drawn the sampling distribution of an estimator, 100 draws from it as s, and 3 interval estimates.
  • One of these interval estimates is calibrated to have exactly 95% coverage. Which is it?
    • A. The one around the on top.
    • B. The one around the in the middle.
    • C. The one around the on the bottom.
  • Hint. You can reach your twin with your arms if your twin can reach you with theirs.
  • Hint. Maybe you look like this and your twin like this |.

Calibration in Reality

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
What You Know Now
0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
What You Knew Then
  • But you didn’t know any of this. You just knew your own point estimate.
  • Without all that post-election information, you didn’t know how to calibrate an interval estimate.
  • But everyone else did. Their widths were almost the same as the width you’d choose now.
0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
Your competitors’ intervals, recentered for easy comparison of width to the sampling distribution’s.
  • They didn’t know the point estimator’s actual sampling distribution…
  • … but they knew enough about it to choose the right interval width.
  • That’s what we’re going to look into now. Over the course of this lecture and the next, we’ll work out what the sampling distributon of our estimator can look like and how what it does look like depends on the population.
  • And we’ll see how to use that information to calibrate our intervals.

Payoff

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
You vs. Your Competitors Now
0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
How You’re Calibrating
  • To estimate this sampling distribution, you plug your point estimate \(\hat\theta\) into the Binomial formula. \[ \hat P\left(\sum_{i=1}^n Y_i = s\right) = \binom{n}{s} \hat\theta^{s} (1-\hat\theta)^{n-s} \quad \text{ estimates } \quad P\left(\sum_{i=1}^n Y_i = s\right) = \binom{n}{s} \theta^{s} (1-\theta)^{n-s} \]

  • To calibrate your interval estimate, you …

    • use rbinom to draw 10,000 samples from this estimate of the sampling distribution.
    • Even remembering to divide by \(n\).
    • And use the function width from the Week 1 Homework to find an interval that covers 95% of them.
theta.hat = mean(Y)
samples = rbinom(10000, n, theta.hat) / n
interval.width = width(samples, alpha=.05)
  • You nail it. Your interval covers the estimation target \(\theta\) just like 95% of your competitors’ do.
0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
You and your competitors’ intervals, recentered for easy comparison of width to your estimators’ sampling distribution’s middle-95% width.
  • It’s not just that you’ve widened your interval enough.
  • You’ve widened it almost exactly the right amount.
  • Just like your competitors. Almost as if you all knew …
  • how to estimate your estimator’s sampling distribution.

Calibration using the Binomial Distribution

Looking Back on Your Success

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
What You Know Now—Plus What You Used For Calibration
0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800
Your Calibration Picture—Plus the Estimation Target
  • Remember your sucessfully calibrated interval estimate from a moment ago?
    • You did that by plugging your point estimate \(\hat\theta\) into the Binomial formula.
    • And you got a nicely calibrated interval estimate. That was great.
  • But let’s take a closer look. Let’s compare your estimate of the sampling distribution to the actual thing.
    • We can do that because we have a bunch of draws from the real thing—all the others polls. s.
    • And if we want more draws, since it’s after the election, we can simulate as many polls as we want.
  • It doesn’t look great. It’s off center.
    • Its mean is a bit higher than the population proportion \(\theta\).
    • It’s actually our sample proportion \(\hat\theta\). That makes sense.
  • The mean of the Binomial distribution with success rate \(\theta\) is \(\theta\) and we’re using \(\hat\theta\) in its place.
  • It turns out that this doesn’t matter much. It worked just fine for calibration. Why?

Calibration Comparison

0.00 0.01 0.02 0.03 0.600 0.625 0.650 0.675 0.700 0.725 0.750 0.775 0.800

  • It doesn’t matter because we’re not putting arms on draws from the estimated sampling distribution.
  • We’re putting arms on our point estimate3, which is a draw from the actual sampling distribution.
  • To do this, we’re using the width—but not the center—of the estimated sampling distribution.
  • And it works because that’s very close to the width we’d get from the actual sampling distribution.
  • Above, I’ve drawn in shaded regions corresponding to two versions of the the population proportion’s arms.
    • The green region is the one we get from the actual sampling distribution. We can’t use this.
    • The red region is the one we get from the estimated sampling distribution. We do use this.
  • And I’ve drawn in a version of our interval estimate calibrated each way. They’re almost the same.

Our Competitors’ Calibration

0.00 0.01 0.02 0.03 0.60 0.65 0.70 0.75 0.80
Actual Sampling Distribution
0.00 0.01 0.02 0.03 0.60 0.65 0.70 0.75 0.80
Estimated Sampling Distribution (Poll 1)
0.00 0.01 0.02 0.03 0.60 0.65 0.70 0.75 0.80
Estimated Sampling Distribution (Poll 2)
0.00 0.01 0.02 0.03 0.60 0.65 0.70 0.75 0.80
Estimated Sampling Distribution (Poll 3)
  • Our competitors’ sampling distributions, just like ours, are centered on their sample frequencies \(\hat\theta\).
  • But they’re all close to the width we get using the actual sampling distribution. You can see it above.
    • I’ve plotted the intervals they’d use — based on their sampling distribution estimates — in bold colors.
    • And the intervals they wish they could — based on the actual sampling distribution — more faintly.
  • If you look very closely, you can see that …
    • the intervals around overestimates are slightly narrower than we’d want.
    • the intervals around underestimates are slightly wider than we’d want.
  • But you have to look very closely. They’re all very close to the actual sampling distribution’s width.

All of Our Competitors

0 5 10 15 20 -0.10 -0.05 0.00 0.05 0.10

  • We saw earlier that all of our competitors had almost-perfectly calibrated intervals.
    • They got their widths by plugging their sample frequencies \(\hat\theta\) into the Binomial formula.
    • And the result was almost exactly as if they’d plugged in the population frequency \(\theta\) instead.
  • Let’s look again. This time, we’ll plot their estimated sampling distributions too.
    • But we’ll shift them all so they’re centered at zero.
    • That way we can compare their widths more easily. Because width is what matters.
  • Each competitor gets their own color and we see their …
    • centered sampling distribution plotted as a line
    • centered interval estimate as a point with arms
  • Compare to the actual sampling distribution (centered and shaded gray) and its middle 95% (dotted lines).

Why Does it Work?

0.00 0.01 0.02 0.03 0.60 0.65 0.70 0.75 0.80

0.00 0.01 0.02 0.03 -0.10 -0.05 0.00 0.05 0.10

  • Why are we getting a good estimate of the sampling distribution?
  • The Binomial distribution is continuous as a function of \(\theta\)—when \(\theta\) changes little, the distribution changes little.
  • This means that, if we have a good estimate of \(\theta\), we have a good estimate of the sampling distribution.
  • The relevant difference (after centering) is even smaller because the way the binomial changes is mostly location.
  • Here I’m showing three estimates of the sampling distribution based on three point estimates \(\hat\theta\).
    • with centering (right) and without (left).
  • In particular, point estimates at the center and two edges of the actual sampling distribution’s middle 95%.

The Estimate Works. Why Does it Work?

0.00 0.01 0.02 0.03 0.60 0.65 0.70 0.75 0.80

0.00 0.01 0.02 0.03 -0.10 -0.05 0.00 0.05 0.10

  • You can think of this as a sort of ‘confidence interval’ for our estimate of the sampling distribution.
    • 95% of the time, you’ll get an estimate somewhere between the red and blue ones.
    • And, as a result, the width of your interval estimate will be somewhere between the red and blue widths.
  • One way of looking at it is, when calibrate interval estimates this way, they’re almost perfectly calibrated.
    • Coverage may not actually be 95% but it’s very close.
    • You can see that the red interval does cover.
      • So will an interval around any point estimate between it and \(\theta\).
    • The blue interval doesn’t cover. It’s a fingernail too narrow.
      • But an interval around any estimate a fingernail smaller will cover.
      • It’ll be at least as wide and a fingernail closer.
  • Another way of looking at it is that 95% of the time, your interval misses by at most a fingernail.
  • This, or bit worse, is usually what’s meant when someone says ‘95% interval.’ Don’t expect perfect calibration.

Footnotes

  1. You say that’s how often, anyway. Hence ‘nominal’.

  2. In technical terms, these estimates are draws from your estimator’s sampling distribution.

  3. We’re coloring it black instead of green here. It’s hard to see green on a green background