# How to calculate the confidence interval for time-series prediction?

I have a time series (let's say $X_1$ to $X_n$), and I need to predict the next sample (let say $X_{n+1}, X_{n+2},\dots, X_{n+k}$) using model such as neural network, or multiple linear regression. At time n, I have all the sample from $X_1$ to $X_n$, and need to predict $X_{n+1}$; at time $n+1$, I have all the sample from $X_1$ to $X_{n+1}$, and need to predict $X_{n+2}$; and so on.

Let say I have predicted values $Y_{n+1}, Y_{n+2},\dots, Y_{n+k}$ by using a model. How can I calculate a confidence interval for those predicted values?

I would appreciate if anyone can help me in this issue. (So far I read the formula for computing confidence interval for mean of a sample, but I didn't see anything about how to calculate the confidence interval for the predicted value of a time series).

• You mean "prediction interval" not "confidence interval". The latter is for a parameter. – Rob Hyndman Mar 22 '12 at 22:32
• Thanks Rob. Actually I want to find the the confidence interval not the prediction interval, to have an idea about the uncertainty in my prediction. I want to have a range around the predicted value where there is a given probability or confidence degree (let's say 95%) of finding the real value. – Mashud Mar 30 '12 at 3:44
• What you have described is precisely a prediction interval. A confidence interval is a statement about a parameter. You want a range around a future observation. – Rob Hyndman Mar 30 '12 at 5:43
• Thanks Rob. Yes, I was wrong in my understanding. This is actually prediction interval. I am sorry for that. I would appreciate if you please let me know few reference of how to calculate the prediction interval of the future observations produced by Neural Network/Multiple Regression Method. – Mashud Apr 2 '12 at 8:11