# Prediction interval

In statistics, a prediction interval bears the same relationship to a future observation that a confidence interval bears to an unobservable population parameter. Prediction intervals predict the distribution of individual points, whereas confidence intervals estimate the true population mean or other quantity of interest that cannot be observed.

In other words, an interval estimate of a parameter, such as a population mean is usually called a confidence interval. An interval estimate of a variable is called a prediction interval.

A common example given in statistics classes is the prediction interval for a response variable when finding the least squares regression line. If the entire population is given in the data, this is not needed. However, if the data is a sample, then the true regression line may not be known. The predicted value of the response variable y, found using the equation of the regression line from the sample data, will have a margin of error. The predicted y value is a statistic, not a parameter. For this y value, a prediction interval can be found. We use the standard deviation (standard error) of the distribution of the slope to do this. The y value is a point estimate and we are looking for a prediction interval for that estimate.

## Example

Suppose one has drawn a sample from a normally distributed population. The mean and standard deviation of the population are unknown except insofar as they can be estimated based on the sample. It is desired to predict the next observation. Let n be the sample size; let μ and σ be respectively the unobservable mean and standard deviation of the population. Let X1, ..., Xn, be the sample; let Xn+1 be the future observation to be predicted. Let

${\displaystyle {\overline {X}}_{n}=(X_{1}+\cdots +X_{n})/n}$

and

${\displaystyle S_{n}^{2}={1 \over n-1}\sum _{i=1}^{n}(X_{i}-{\overline {X}}_{n})^{2}.}$

Then it is fairly routine to show that

${\displaystyle {X_{n+1}-{\overline {X}}_{n} \over {\sqrt {S_{n}^{2}+S_{n}^{2}/n}}}={X_{n+1}-{\overline {X}}_{n} \over S_{n}{\sqrt {1+1/n}}}}$

has a Student's t-distribution with n − 1 degrees of freedom. Consequently we have

${\displaystyle \Pr \left({\overline {X}}_{n}-T_{a}S_{n}{\sqrt {1+(1/n)}}\leq X_{n+1}\leq {\overline {X}}_{n}+T_{a}S_{n}{\sqrt {1+(1/n)}}\,\right)=p}$

where Ta is the 100((1 + p)/2)th percentile of Student's t-distribution with n − 1 degrees of freedom. Therefore the numbers

${\displaystyle {\overline {X}}_{n}\pm T_{a}{S}_{n}{\sqrt {1+(1/n)}}}$

are the endpoints of a 100p% prediction interval for Xn + 1.