Skip to main content
How to do automatic forecasting using AutoARIMA, AutoETS, AutoCES and AutoTheta.
Tip Automatic forecasts of large numbers of univariate time series are often needed. It is common to have multiple product lines or skus that need forecasting. In these circumstances, an automatic forecasting algorithm is an essential tool. Automatic forecasting algorithms must determine an appropriate time series model, estimate the parameters and compute the forecasts. They must be robust to unusual time series patterns, and applicable to large numbers of series without user intervention.

1. Install statsforecast and load data

Use pip to install statsforecast and load Air Passengers dataset as an example

2. Import StatsForecast and models

Import the core StatsForecast class and the models you want to use

3. Instantiate the class

Instantiate the StatsForecast class with the appropriate parameters

4. a) Forecast with forecast method

The .forecast method is faster for distributed computing and does not save the fittted models
unique_iddsAutoARIMAAutoETSAutoThetaCES
01.01961-01-31444.309575442.357169442.940797453.03418

4. b) Forecast with fit and predict

The .fit method saves the fitted models
unique_iddsAutoARIMAAutoETSAutoThetaCES
01.01961-01-31444.309575442.357169442.940797453.03418

References

Hyndman, RJ and Khandakar, Y (2008) “Automatic time series forecasting: The forecast package for R”, Journal of Statistical Software, 26(3).