The upper and lower prediction intervals for the forecast periods are provided by the forecast() function. However, neither prediction or confidence intervals seem to be available for the fitted values within the range of the actual data. Why is this?


1 Answer 1


The fitted values are one-step forecasts, so prediction intervals can be obtained by adding/subtracting a suitable multiple of the standard deviation of the residuals. E.g., assuming normal errors, an approximate 95% prediction interval is given by $\hat{y}_t\pm 1.96\hat{\sigma}$ where $\hat\sigma^2$ is the variance of the residuals.

Presumably you mean a confidence interval for the mean of the one-step forecast distributions. I'm not sure why you would want such a thing but you could obtain it by reformulating the model in state space form and using a Kalman filter.

You ask why the forecast() function does not provide these. Simply, because they are hardly ever useful.

  • $\begingroup$ Yes, it makes sense that you really only care about the precision of your forecast. I am accustomed to the intervals returned by predict.lm. Thanks for taking time to explain. $\endgroup$
    – Scott
    Jan 3, 2012 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.