Time series models

Modeling time series can become very complex; here, we will go through some of the most employed models one by one and explain some of the ideas behind them. We will start with the autoregressive model, continue with the moving average model, and finish off with the combined autoregressive integrated moving average model. To start off this section, import the statsmodel time series model framework:

from statsmodels.tsa.arima_model import ARIMA 

The ARIMA function takes a Pandas time series and model parameters as input and sends back a model object. To use a combination of the decomposition and differencing method in order to make the time series stationary, I first removed the seasonal component broken out by the statsmodels ...

Get Mastering Python Data Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.