I'm trying to understand how fitted values are calculated for ARMA(p,q) models. I've already found a question on here concerning fitted values of ARMA processes but haven't been able to make sense of it.
If I have a ARMA(1,1) model, i. e.
$$X_t = \alpha_1X_{t-1}+\epsilon_t – \beta_1 \epsilon_{t-1}$$
and am given a (stationary) time series I can estimate the parameters. How would I calculate the fitted values using those estimates. For an AR(1) model the fitted values are given by
$$\hat{X_t} = \hat{\alpha_1}X_{t-1} . $$
Since the innovations in an ARMA model are unobservable how would I use the estimate of the MA parameter? Would I just ignore the MA part and calculate the fitted values of the AR part?
Best Answer
To answer your questions, you basically need to know how the residuals i.e. $e_t$ are calculated in an
arma
model. Because then $\hat{X_{t}}=X_{t}-e_{t}$. Let's first generate a fake data ($X_t$) fromarima(.5,.6)
and fit thearma
model (without mean):Now I create the residuals as follows: $e_1=0$ (since there is no residual at 1) and for $t=2,...,n$ we have: $e_t=X_t-Ar*X_{t-1}-Ma*e_{t-1}$, where $Ar$ and $Ma$ are the estimated auto-regressive and moving average part in above fitted model. Here is the code:
Once you find the residuals $e_{t}$, the fitted values are just $\hat{X_{t}}=X_{t}-e_{t}$. So in the following, I compared the first 10 fitted values obtained from R and the ones I can calculate from $e_{t}$ I created above (i.e. manually).
As you see there are close but not exactly the same. The reason is that when I created the residuals I set $e_{1}=0$. There are other choices though. For example based on the help file to
arima
, the residuals and their variance found by a Kalman filter and therefore their calculation of $e_t$ will be slightly different from me. But as time goes on they are converging.Now for the Ar(1) model. I fitted the model (without mean) and directly show you how to calculate the fitted values using the coefficients. This time I didn't calculate the residuals. Note that I reported the first 10 fitted values removing the first one (as again it would be different depending on how you define it). As you can see, they are completely the same.