Till the previous segments, you built the Auto Regressive models on a stationary series (remember after Box-Cox transformation and differencing). Suppose you have a series with a trend in it. How will you build an Auto Regressive model on a series with a trend?

In this segment, you will learn another Auto Regressive model which models a series with the trend. It has an embedded parameter that differences the series to remove the trend and later integrate it into the original series. Let us look at what Chiranjoy has to say about Auto Regressive Integrated Moving Average or ARIMA.

**Steps of ARIMA model**

- Original time series is differenced to make it stationary.

- Differenced series is modelled as a linear regression of.

One or more past observations.

Past forecast errors

- ARIMA model has three parameters.

** p:** Highest lag included in the regression model.

** d:** Degree of differencing to make the series stationary.

** q:** Number of past error terms included in the regression model.

Here the new parameter introduced is the ‘I’ part called integrated. It removes the trend (non-stationarity) and later integrates the trend to the original series.

So if you think about it, ARIMA is nothing different from what you have done so far. Initially you applied both the boxcox transformation and differencing in order to covert the data into a stationary time-series data. Here, you are just applying boxcox before building the model and letting the model take care of the differencing i.e. the trend component itself.

Let’s now quickly revisit the equations.

**ARIMA(1,1,1) Equations:**

$$//${z}_{t}={\varnothing}_{t}{z}_{t\u20131}+{\theta}_{1}{\in}_{t}+{\in}_{t}\phantom{\rule{0ex}{0ex}}Where\phantom{\rule{0ex}{0ex}}{z}_{t}={y}_{t+1}\u2013{y}_{t}$//$$

Here, Zt is the first order differencing for time series.

**To determine the parameters ‘p’, ‘d’ and ‘q’**

- For ‘d’: Select d as the order of difference required to make the original time series stationary. We can verify if this differenced series is stationary or not by using the stationarity tests: ADF or KPSS test.

- For ‘p’ and ‘q’: Plot ACF and PACF of the 1st order differenced time series. Find the value of ‘p’ and ‘q’ as discussed previously with the earlier Auto Regressive Models.

- The last step in the ARIMA model is to recover the original time series forecast.

Now that we have a theoretical understanding of the ARIMA model, let us see the coding demonstration of the ARIMA model using the same airline passenger data.

In the next segment, you will study the Auto Regressive model that can now capture the seasonal component of the time series as well that is the Seasonal Auto-Regressive Integrated Moving Average