1

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!

b2amen
  • 147

1 Answers1

4

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
  • 1
    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
  • I am unaware of any package that has an ARIMA command. Perhaps you mean the arima command from the stats package, or the Arima command from the forecast package. – Rob Hyndman Jul 15 '13 at 01:31
  • Yes, from the stats package. – gregory_britten Jul 15 '13 at 11:52
  • @gregoire_dube: currently, i have all estimates for my parameters. My major problem is to estimate the $ e_{t} $. – b2amen Jul 15 '13 at 18:47
  • @RobHyndman: any assistance from any R package is really welcome. I would also appreciate any manual way for which I could estimate this $ e_{t} $ – b2amen Jul 15 '13 at 18:49
  • 1
    I've fixed the answer so the code will now work. It is too hard to do it manually without writing a lot of code. Just use what is already provided. – Rob Hyndman Jul 15 '13 at 22:44
  • @RobHyndman: Thanks a lot. But this is the error i get when i run the code: "Error: object 'model' not found". I changed the x to suite my data anyway. I don't see what i am doing wrong too. Can you help me? – b2amen Jul 16 '13 at 00:51
  • Try the code now. – Rob Hyndman Jul 16 '13 at 03:59
  • @RobHyndman: Thanks a lot. That works now. My data is on unemployment rates from January 2007 to December 2012. This code gives me error estimates from January 2007 to December 2012. My problem is on how to determine the error estimate for one month ahead (thus January 2013), from my forecast model. – b2amen Jul 16 '13 at 15:52
  • You will not generate an 'error' for unobserved values, as this is of course not possible. But in terms of prediction, the predicted value of your error $\tau$ time steps in the future $e_{t+\tau}$ will be the mean of the error distribution (likely zero). So predictions will be generated assuming $e_t=0$. You can generate predictions using your fitted arima model by using the predict() command in which you will specify the n.ahead argument. It will also produce standard errors of prediction which expand as you go further out in time. – gregory_britten Jul 16 '13 at 16:39
  • I've added the command to the answer. – gregory_britten Jul 16 '13 at 16:44
  • Is there something more you are looking for @b2amen? It appears to me this question is answered. – gregory_britten Jul 18 '13 at 15:02