Algorithm Search⌘K

Definitioncore

Prediction interval

Also called predictive interval.

An interval that contains a future observation, not a parameter, with a stated probability. It is wider than the confidence interval for the mean.

A prediction interval is an interval, computed from observed data X1,…,XnX_1, \ldots, X_n, that contains a future observation YY with a stated probability 1−α1 - \alpha. The target is a random variable, not a fixed parameter, so the interval must allow both for the error in estimating the parameters and for the spread of YY itself. For normal data the exact interval is Xˉ±t(n−1,1−α/2) S1+1/n\bar X \pm t_{(n-1, 1-\alpha/2)}\, S\sqrt{1 + 1/n}, which is wider than the t confidence interval for the mean by the factor n+1\sqrt{n + 1} and does not shrink to a point as nn grows.

Definition

Let X=(X1,…,Xn)X = (X_1, \ldots, X_n) and a future value YY have a joint law PθP_\theta, θ∈Θ\theta \in \Theta. Usually X1,…,Xn,YX_1, \ldots, X_n, Y are iid, or YY is a new response at a known covariate value in a regression.

Prediction interval. A pair of statistics L(X)≤U(X)L(X) \le U(X) is a prediction interval of level 1−α1 - \alpha for YY if

Pθ(L(X)≤Y≤U(X))≥1−αfor every θ∈Θ.P_\theta\big(L(X) \le Y \le U(X)\big) \ge 1 - \alpha \quad \text{for every } \theta \in \Theta.

The probability is over both XX and YY. This is marginal coverage. The conditional coverage π(X)=Pθ(L(X)≤Y≤U(X)∣X)\pi(X) = P_\theta(L(X) \le Y \le U(X) \mid X) is a random variable whose mean is the marginal coverage; the definition does not ask that it be at least 1−α1 - \alpha for each data set. A one-sided prediction bound has L=−∞L = -\infty or U=+∞U = +\infty.

Construction from a pivot. If Q(X,Y)Q(X, Y) has a law GG that is the same for every θ\theta, then {y:a≤Q(X,y)≤b}\{y : a \le Q(X, y) \le b\} with G([a,b])≥1−αG([a, b]) \ge 1 - \alpha is a prediction set of level 1−α1 - \alpha. The proof is the one on the pivotal quantity page, with YY in place of the parameter: the event that YY is in the set is the event a≤Q(X,Y)≤ba \le Q(X, Y) \le b.

Normal model. If X1,…,Xn,YX_1, \ldots, X_n, Y are iid N(μ,σ2)N(\mu, \sigma^2) with both parameters unknown, then Y−Xˉ∼N(0,σ2(1+1/n))Y - \bar X \sim N(0, \sigma^2(1 + 1/n)), it is independent of S2S^2 (since YY is independent of the sample and Xˉ\bar X is independent of S2S^2), and (n−1)S2/σ2(n - 1)S^2/\sigma^2 is chi-square with n−1n - 1 degrees of freedom. So

Y−XˉS1+1/n∼tn−1\frac{Y - \bar X}{S\sqrt{1 + 1/n}} \sim t_{n-1}

for every (μ,σ)(\mu, \sigma), and the interval Xˉ±t(n−1,1−α/2) S1+1/n\bar X \pm t_{(n-1, 1-\alpha/2)}\, S\sqrt{1 + 1/n} has marginal coverage exactly 1−α1 - \alpha. Here t(n−1,p)t_{(n-1, p)} is the lower pp quantile.

Distribution-free interval from order statistics. Let X1,…,Xn,YX_1, \ldots, X_n, Y be iid from any continuous law, and let X(1)<⋯<X(n)X_{(1)} < \cdots < X_{(n)} be the order statistics of the sample. For 0≤j<k≤n+10 \le j < k \le n + 1, with X(0)=−∞X_{(0)} = -\infty and X(n+1)=+∞X_{(n+1)} = +\infty,

P(X(j)<Y<X(k))=k−jn+1.P\big(X_{(j)} < Y < X_{(k)}\big) = \frac{k - j}{n + 1}.

Proof. The n+1n + 1 values are iid and continuous, so they are distinct with probability 1, and every ordering of them is equally likely. The rank RR of YY among them is therefore uniform on {1,…,n+1}\{1, \ldots, n + 1\}. YY lies strictly between X(j)X_{(j)} and X(k)X_{(k)} exactly when j+1≤R≤kj + 1 \le R \le k, which happens for k−jk - j of the n+1n + 1 ranks. □\square

The proof uses only that the n+1n + 1 values are exchangeable with no ties, and it holds for every continuous law. This is the simplest case of conformal prediction, which ranks a conformity score instead of the raw value.

Examples and non-examples

The examples use the data x=(4.1,5.3,4.8,6.0,5.2)x = (4.1, 5.3, 4.8, 6.0, 5.2), with xˉ=5.08\bar x = 5.08, s=0.697854s = 0.697854 and t(4,0.975)=2.776445t_{(4, 0.975)} = 2.776445.

Normal prediction interval. The 95% interval is 5.08±2.776445×0.697854×1.2=5.08±2.12248=[2.9575,7.2025]5.08 \pm 2.776445 \times 0.697854 \times \sqrt{1.2} = 5.08 \pm 2.12248 = [2.9575, 7.2025]. The 95% t confidence interval for μ\mu from the same data is [4.2135,5.9465][4.2135, 5.9465]. The ratio of the half-widths is 1+1/n/1/n=6=2.449\sqrt{1 + 1/n}/\sqrt{1/n} = \sqrt 6 = 2.449. As n→∞n \to \infty the prediction interval tends to μ±z0.975σ\mu \pm z_{0.975}\sigma, of width about 3.92σ3.92\sigma, while the confidence interval shrinks to the point μ\mu.

Order-statistic interval. For the same five values, [X(1),X(5)]=[4.1,6.0][X_{(1)}, X_{(5)}] = [4.1, 6.0] has coverage 4/6=0.6674/6 = 0.667 for any continuous law. To reach 95% with the range [X(1),X(n)][X_{(1)}, X_{(n)}] one needs (n−1)/(n+1)≥0.95(n - 1)/(n + 1) \ge 0.95, that is n≥39n \ge 39. With n=19n = 19 the range has coverage 18/20=0.9018/20 = 0.90; a simulation of 20000 uniform samples (seed 3) gave 0.8978.

Conditional coverage varies. For normal data with n=5n = 5, the conditional coverage π(X)\pi(X) of the 95% interval has mean 0.95 but is spread out. In 20000 simulated samples (seed 1) its median was 0.990, it was below 0.90 in 15.5% of samples and below 0.80 in 6.8%. These are measured, not proved. A tolerance interval, which asks that π(X)≥β\pi(X) \ge \beta with confidence γ\gamma, controls this, and is wider.

Regression. In the least squares linear model Y=x⊤β+εY = x^\top \beta + \varepsilon with normal errors and pp coefficients, a new response at x0x_0 has the interval x0⊤β^±t(n−p,1−α/2) S1+x0⊤(X⊤X)−1x0x_0^\top \hat\beta \pm t_{(n-p, 1-\alpha/2)}\, S\sqrt{1 + x_0^\top (X^\top X)^{-1} x_0}. The confidence interval for the mean response x0⊤βx_0^\top \beta has the same form without the 1 under the root.

Non-example: the normal interval on skewed data. The t-based interval is exact only for normal data. For iid exponential data with mean 1, simulation with 20000 repetitions (seed 2) gave coverage 0.923 at n=5n = 5 and 0.945 at n=50n = 50. At n=50n = 50 the total is close to 0.95, but all of the misses were above the interval (5.5%) and none below, so each one-sided bound is wrong. Unlike a confidence interval for the mean, the prediction interval does not become valid as nn grows under the central limit theorem, because YY keeps its own non-normal law.

Non-example: a confidence interval used to predict. The 95% t confidence interval [4.2135,5.9465][4.2135, 5.9465] for μ\mu does not contain a new observation with probability 0.95. For normal data with n=5n = 5 its marginal coverage of YY is P(∣T∣≤2.776445/6)P(\lvert T \rvert \le 2.776445/\sqrt 6) for T∼t4T \sim t_4, which is 0.680.

Non-example: a credible interval for μ\mu. A Bayesian credible interval for μ\mu is a statement about the parameter, like a confidence interval. The Bayesian analogue of a prediction interval is an interval of the posterior predictive distribution, and its highest-density form is the HPD region of that distribution. With the reference prior p(μ,σ)∝1/σp(\mu, \sigma) \propto 1/\sigma and normal data, the 95% posterior predictive interval equals the frequentist interval xˉ±t(n−1,0.975) s1+1/n\bar x \pm t_{(n-1, 0.975)}\, s\sqrt{1 + 1/n}, but its probability is conditional on the data, not marginal over samples.

  • Confidence interval. A confidence interval covers a fixed parameter. A prediction interval covers a random future value, so it adds the variance of YY to the variance of the estimate.
  • Tolerance interval. An interval that contains at least a proportion β\beta of the population with confidence γ\gamma. It is a statement about the conditional coverage π(X)\pi(X), while a prediction interval is a statement about its mean.
  • Conformal prediction. Conformal prediction and split conformal prediction extend the order-statistic interval to any model and any score, with marginal coverage at least 1−α1 - \alpha under exchangeability alone.
  • Test inversion. A prediction set is the set of values yy that a level-α\alpha test of "Y=yY = y comes from the same law as the sample" does not reject; this is the test-interval duality with YY in place of the parameter.

References

  1. William Q. Meeker, Gerald J. Hahn and Luis A. Escobar, Statistical Intervals, A Guide for Practitioners and Researchers, second edition, Wiley, 2017, Chapter 2 (types of intervals), Chapter 4 (normal-distribution prediction intervals), Chapter 5 (distribution-free intervals, Section 5.4 on ordered observations) and Appendix E.6 (prediction intervals from pivotal quantities)
  2. Vladimir Vovk, Alex Gammerman and Glenn Shafer, Algorithmic Learning in a Random World, Springer, 2005, Chapter 2 (conformal prediction and its validity under exchangeability)
  3. George Casella and Roger L. Berger, Statistical Inference, second edition, Duxbury, 2002, Chapter 5 (the t distribution and order statistics) and Chapter 9 (interval estimation)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/KKNWHF/text.yaml