# Documentation

## Autoregressive Moving Average Model

### ARMA(p,q) Model

For some observed time series, a very high-order AR or MA model is needed to model the underlying process well. In this case, a combined autoregressive moving average (ARMA) model can sometimes be a more parsimonious choice.

An ARMA model expresses the conditional mean of yt as a function of both past observations, ${y}_{t-1},\dots ,{y}_{t-p}$, and past innovations, ${\epsilon }_{t-1},\dots ,{\epsilon }_{t-q}.$The number of past observations that yt depends on, p, is the AR degree. The number of past innovations that yt depends on, q, is the MA degree. In general, these models are denoted by ARMA(p,q).

The form of the ARMA(p,q) model in Econometrics Toolbox™ is

 ${y}_{t}=c+{\varphi }_{1}{y}_{t-1}+\dots +{\varphi }_{p}{y}_{t-p}+{\epsilon }_{t}+{\theta }_{1}{\epsilon }_{t-1}+\dots +{\theta }_{q}{\epsilon }_{t-q},$ (5-10)

where ${\epsilon }_{t}$ is an uncorrelated innovation process with mean zero.

In lag operator polynomial notation, ${L}^{i}{y}_{t}={y}_{t-i}$. Define the degree p AR lag operator polynomial $\varphi \left(L\right)=\left(1-{\varphi }_{1}L-\dots -{\varphi }_{p}{L}^{p}\right)$. Define the degree q MA lag operator polynomial $\theta \left(L\right)=\left(1+{\theta }_{1}L+\dots +{\theta }_{q}{L}^{q}\right)$. You can write the ARMA(p,q) model as

 $\varphi \left(L\right){y}_{t}=c+\theta \left(L\right){\epsilon }_{t}.$ (5-11)

The signs of the coefficients in the AR lag operator polynomial, $\varphi \left(L\right)$, are opposite to the right side of Equation 5-10. When specifying and interpreting AR coefficients in Econometrics Toolbox, use the form in Equation 5-10.

### Stationarity and Invertibility of the ARMA Model

Consider the ARMA(p,q) model in lag operator notation,

$\varphi \left(L\right){y}_{t}=c+\theta \left(L\right){\epsilon }_{t}.$

From this expression, you can see that

 ${y}_{t}=\mu +\frac{\theta \left(L\right)}{\varphi \left(L\right)}{\epsilon }_{t}=\mu +\psi \left(L\right){\epsilon }_{t},$ (5-12)

where

$\mu =\frac{c}{\left(1-{\varphi }_{1}-\dots -{\varphi }_{p}\right)}$

is the unconditional mean of the process, and $\psi \left(L\right)$ is a rational, infinite-degree lag operator polynomial, $\left(1+{\psi }_{1}L+{\psi }_{2}{L}^{2}+\dots \right)$.

 Note:   The `Constant` property of an `arima` model object corresponds to c, and not the unconditional mean μ.

By Wold's decomposition [1], Equation 5-12 corresponds to a stationary stochastic process provided the coefficients ${\psi }_{i}$ are absolutely summable. This is the case when the AR polynomial, $\varphi \left(L\right)$, is stable, meaning all its roots lie outside the unit circle. Additionally, the process is causal provided the MA polynomial is invertible, meaning all its roots lie outside the unit circle.

Econometrics Toolbox enforces stability and invertibility of ARMA processes. When you specify an ARMA model using `arima`, you get an error if you enter coefficients that do not correspond to a stable AR polynomial or invertible MA polynomial. Similarly, `estimate` imposes stationarity and invertibility constraints during estimation.

## References

[1] Wold, H. A Study in the Analysis of Stationary Time Series. Uppsala, Sweden: Almqvist & Wiksell, 1938.