# How do I estimate the $e_t$ from a moving average model?

I have an ARIMA(0,2,1) model. How do i estimate the $\hat{e}_t$ component of the model. I have read a whole lot of theories that confuses me the more. Is there any practical way of estimating this $\hat{e}_t$? Does R offer any help to that too?

I know that my ARIMA(0,2,1) model can be written as $Y_{t} = 2Y_{t-1} - Y_{t-2} + e_{t} + \theta e_{t-1}$. I want to forecast 1-time ahead into the future. In that case, my forecast equation is given as $\hat Y_{t}(1) = 2Y_{t} -Y_{t-1} + \theta \hat e_{t}$. I know my value for $Y_{t} =7.8$ and $Y_{t-1} =7.8$. I know my value of \theta as -0.6816, which i obtained from my R output. My problem now is, how do i determine the value for my $\hat e_{t}$ so i could find $\hat Y_{t}(1)$? I have an R code that gives me all these forecasts though, but i want to know how R generated my first forecast and how it found the estimate for $\hat e_{t}$.

Thanks for looking!

• Well, it was mostly @COOLSerdash but you're welcome! – Gala Jul 11 '13 at 13:53
• @GaëlLaurans My edits were minimal at best :) gregoire_dube did most of it (initially). – COOLSerdash Jul 11 '13 at 14:03
• thanks you two. I had followed your edits to present make some nice editing of my own. Thanks. – b2amen Jul 11 '13 at 14:07

I assume you want to find the fitted residual series $\hat{e}_t$ for $t = 1,2,...,T$.
If you are fitting your ARIMA model in R using the arima() command, then you will find the fitted residuals by:
fitted_model <- arima(x) #x is your time series
fitted_residuals <- fitted_model$residuals #the vector of residuals  Now generate your predictions$n$timesteps into the future, say$n=100$: prediction_vector <- predict(fitted_model,n.ahead=100)  • @gregoire_dude: Thanks for your answer. I have edit my question now. I hope that gives better information of what i really wanted. Could you take a peep at it now? – b2amen Jul 11 '13 at 14:02 • OK. I believe you are asking how the model is 'initiated' because, for example,$\hat{Y}_1$and similarly$\hat{e}_1$require values from the past which are not observed. It's a good question. Some assumptions are required to generate estimates for these quantities. See the previous question here. – gregory_britten Jul 11 '13 at 15:25 • It is a helpful document though, but it doesn't seem to really give me what i wanted – b2amen Jul 11 '13 at 15:38 • I'm not 100% on the exact way ARIMA() does this, but it will surely involve a similar approach to the Box-Jenkins methodology which involves 'backcasting'. The way to do this is 1) assume the unobserved data are equal to$\bar{y}\$ and the unestimated error equal to 0; 2) estimate the parameters of the ARIMA model by MLE; 3) backcast to estimate the initial values. – gregory_britten Jul 11 '13 at 16:33