# Fixed Prediction Interval

I want to place a Multiple Regression model into a production system and use the Prediction Interval as a threshold for anomalies.

I've seen how I can calculate the Prediction Interval two ways:

$$\hat{y} \pm 1.96 \hat{\sigma} \sqrt{1 + \mathbf{X}^* (\mathbf{X}'\mathbf{X})^{-1} (\mathbf{X}^*)'}.$$ Referenced here

and

$$\hat{y}_h \pm t_{(\alpha/2, n-p)} \times \sqrt{MSE + [\textrm{se}(\hat{y}_{h})]^2}$$ Referenced here

With the first it seems like the prediction interval value changes based on new observations ($\mathbf{X}^*$) and the second appears to be a fixed prediction interval based off of one initial calculation after creating the regression model.

I would personally like to use a fixed prediction interval for the case I'm considering but I'm not certain if I'm thinking about this all wrong.

Are these two prediction interval calculations different from each other?

• Welcome to Cross Validated! Can you add references to where you've seen these formulae & explain the notation? If h is indexing a covariate pattern the only difference seems to be in the use of the t-distribution rather than the normal in the second. The centre of a prediction interval certainly changes according to the predictor values for which you're making a prediction; &, though less obviously, so does the width: See Linear regression prediction interval. Another thing that might help is to step back a bit & explain your actual problem. Jun 6 '16 at 21:44
• Thanks for the quick response. I added the references above. I do understand that the center of a prediction interval will change as the predictor values change but what I'm confused about is if the width of the prediction interval changes based on new values from the predictors. It appears that it does based on the link you referenced for a prediction interval on a simple linear regression. I had assumed since the second formula I posted just used the standard error of the estimate that I could get this value after creating the model and have a $\hat y \pm constant$. Jun 7 '16 at 18:04
• "$\hat{y}_h$ is the 'fitted value' or 'predicted value' of the response when the predictor values are $\mathbf{X}_h$" it says in the second link. There's no implication that $\mathrm{se}(\hat{y}_h)$ is constant - if it were there'd be no point in writing it as a function of $\hat{y}_h$. Jun 7 '16 at 21:05

I did find that the $se(\hat y_h)$ is defined as follows:

$$\textrm{se}(\hat{y}_{h})=\sqrt{\textrm{MSE}(\textbf{X}_{h}^{\textrm{T}}(\textbf{X}^{\textrm{T}}\textbf{X})^{-1}\textbf{X}_{h})}$$

Which shows that the two formulas mentioned in my question are equivalent. I also found the following for approximating 95% prediction intervals:

$$\hat y \pm 2\times RMSE$$

Referenced Here

Using only the Root-Mean-Square Error allows for a fixed prediction interval, however, you are ignoring the estimation error.

Thanks for the help.