Automatic Time Series Forecasting
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 Passangers dataset as an example
2. Import StatsForecast and models
Import the core StatsForecast class and the models you want to use
3. Instatiate 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_id | ds | AutoARIMA | AutoETS | AutoTheta | CES | |
---|---|---|---|---|---|---|
0 | 1.0 | 1961-01-31 | 444.309575 | 442.357169 | 442.940797 | 453.03418 |
4. b) Forecast with fit and predict
The .fit
method saves the fitted models
unique_id | ds | AutoARIMA | AutoETS | AutoTheta | CES | |
---|---|---|---|---|---|---|
0 | 1.0 | 1961-01-31 | 444.309575 | 442.357169 | 442.940797 | 453.03418 |