Forecasting the future with ARMA and ARIMA models

The autoregressive moving average (ARMA) model and its generalization—the autoregressive integrated moving average (ARIMA) model—are the two most commonly used models to predict the future from time series data. The generalization of the ARIMA model comes from the integrated part: the first step of the model is to differentiate data before estimating the AR and MA parts.

Getting ready

To execute this recipe, you will need pandas, NumPy, Statsmodels, and Matplotlib. You will also need the data prepared in the previous recipe. No other prerequisites are required.

How to do it…

We wrap our process within methods so that most of the modeling is automated (the file):

def plot_functions(data, ...

Get Practical Data Analysis Cookbook 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.