Time Series Forecasting Equation for ARIMAX(1,0,2) model I am working on a time series model with exogenous regressors. I am using the ARIMA function in R which resulted in a ARIMA(1,0,2) model. I also need to forecast for the next 10 months using this model. I am using the R forecast package predict function for the same:
Forecast<- predict(model, newxreg = newxreg)
Since the model has a MA term and I am trying to forecast 10 months ahead of time, I do not have the information for the MA terms in future since I don't know the actuals. So how is the package providing the forecast results?
Can someone please help me understand how forecast package (predict function) in R is estimating the future residual terms and providing the forecasts??
 A: In MA(q) the errors are treated like any other time series. Once you have fit your AR(1) model you have a time series of errors $\epsilon_{t}$, $\epsilon_{t-1}$, $\epsilon_{t-2}$...$\epsilon_{t-i}$. Parameters are selected for $\theta$ that best fit this time series of errors. 
Your MA(q) equation is: $\epsilon_{t+j}$ = β$_{0}$ +$\theta_{1}$ε$_{t+j-1}$+ ...+ $\theta_{q}$ε$_{t+j-q}$
Once $\theta$ is know then you can use the above equation to estimate future values of $\epsilon$. Each predicted value of $\epsilon$ for example the predicted value $\epsilon_{t+1}$ becomes the input for the next estimate  $\epsilon_{t+2}$. It's similar to estimating future values of $Y$ using AR, the estimated value of $Y_{t+i}$ then becomes the input for estimating $Y_{t+i+1}$.
A: Here is a simpler example that I hope should clear things up.
Consider an MA(1) model:
$y_{t+1} = \theta \varepsilon_{t} + \varepsilon_{t+1}$
The forecast, one period ahead from $t$, is the conditional expectation:
$\hat{y}_{t+1} = E\left(y_{t+1}\mid y_1,...,y_t\right) = E\left(\theta \varepsilon_t + \varepsilon_{t+1}\mid y_1,...,y_t\right) = \theta \varepsilon_t + 0 = \theta \varepsilon_t$
Now, the forecast two periods ahead is computed similarly:
$\hat{y}_{t+2} = E\left(y_{t+2}\mid y_1,...,y_t\right) = E\left(\theta \varepsilon_{t+1} + \varepsilon_{t+2}\mid y_1,...,y_t\right) = 0 + 0 = 0$
The forecast more than two periods ahead is also identically zero. Whatever package you are using is essentially just doing this conditional expectation computation, given whatever parameter estimates you have, and an estimate of $\varepsilon_t$, which is derived routinely while estimating the model. 
