# In the ARMA model from the Python statsmodel library, what does the second order parameter represent?

I know ARMA is a combination of two models: The autoregressive model (AR) & moving average model (MA). Both models take up an order parameters which determines how many past data points will be used in the equation.

Now, what puzzles me, is that the ARMA model requires three parameters instead of two. The order parameter in statsmodels.tsa.arima_model.ARMA requires a triple.

The documentation says:

order : iterable

The (p,q) order of the model for the number of AR parameters, differences, and MA parameters to use.


I understand what the first & third parameters mean, but I have no clue what 'differences' is supposed to represent. I've searched extensively, but can't find any documentation that explains this well. Any help would greatly be appreciated.

## 1 Answer

In an ARIMA process of order (p,d,q), parameter d is how much you difference the process to make it ARMA. For example, process $X_t$ is ARIMA(p,2,q) if

$(X_t – X_{t-1})\ \ –\ (X_{t-1} – X_{t-2}) = Z_t,$

$Z_t = \mu + \phi_1 Z_{t-1} +\ ... +\ \phi_p Z_{t-p} + \epsilon_t + \psi_1 \epsilon_{t-1} +\ ... +\ \psi_q \epsilon_{t-q},$

where $\epsilon_t$, ..., $\epsilon_{t-q}$ are independent random shocks.