0

Using linear regression as an equation for prediction is straightforward with,

$$ Y_i = \beta_0 + \beta_1 X_i. $$

Once the betas are estimated I can insert different values of $X$ to use as a what-if analysis for different scenarios.

But trying to do the same with ARIMA models is proving difficult to translate. For example with an ARIMA(2,1,1) model, how do I create an equation where I can try out different scenarios to see how the projection changes?

Below I have the output for a projection of sales based on past sales and extra regressors. I see that a unit change in poc0_3_PER results in a 135.2229 change in sales. But how do I account for the moving average and auto-regression components?

arima(ts.count, order=c(2,1,1), xreg=df.back[3:4])

Call:
arima(x = ts.count, order = c(2, 1, 1), xreg = df.back[3:4])

Coefficients:
          ar1     ar2     ma1  poc0_3_PER
      -0.4569  0.2458  0.9455    135.2229

I have ar1 and ar2 estimates along with ma1 and the extra regressors. How do I convert this into a working equation wherein I can try out different scenarios for the extra regressors to see how the prediction is affected?

I'm hoping that the solution is not an equation like this post here. I do have SARIMA models at times with orders like SARIMA(2,0,1)(1,0,1)[12].

Pierre L
  • 778
  • 2
  • 8
  • 21

1 Answers1

4

Let $y$ denote ts.count and $x$ denote poc0_3_PER. Then

$$ \begin{aligned} \Delta y_t &= 135.2229 x_t + u_t \\ u_t &= -0.4569 u_{t-1} + 0.2458 u_{t-2} + \varepsilon_t + 0.9455 \varepsilon_{t-1} \end{aligned} $$

For example, if you have $y_{t-1}$, $x_t$, $u_{t-1}$, $u_{t-2}$ and $\varepsilon_{t-1}$, the point prediction of $y_t$ will be

$$ \hat y_t = y_{t-1} + 135.2229 x_t - 0.4569 u_{t-1} + 0.2458 u_{t-2} + 0 + 0.9455 \varepsilon_{t-1} $$ (as $\hat\varepsilon_t=0$).

If you do not have $u_{t-1}$ and $u_{t-2}$ directly, you can get them as $u_{t-1} = \Delta y_{t-1} - 135.2229 x_{t-1}$ and $u_{t-2} = \Delta y_{t-2} - 135.2229 x_{t-2}$, respectively. Meanwhile, $\varepsilon_t$ can be found as the model residual by applying resid(modelname) where modelname is the fitted ARIMA model object.

Richard Hardy
  • 54,375
  • 10
  • 95
  • 219
  • Thank you for clarifying @RichardHardy. What is $u$ in this case? For example: $y_{t-1}=5000$, and $x_t = 5$ How do I determine the $u_{t-1}$, $u_{t-2}$ parameters? – Pierre L Mar 31 '16 at 17:29
  • Where can I read more on $u$? – Pierre L Mar 31 '16 at 18:22
  • I have edited the post, so there is a little bit on how $u$ is obtained from a fitted model. I looked at Rob J. Hyndman's blog post ["The ARIMAX model muddle"](http://robjhyndman.com/hyndsight/arimax/) when composing the answer. A broader consideration of the model could be found in Hyndman & Athanasopoulos ["Forecasting: Principles and Practice"](https://www.otexts.org/fpp/9/1). – Richard Hardy Mar 31 '16 at 18:25