liveBook · Manning

ExponentialSmoothing

As explained in Statistics Every Programmer Needs

ExponentialSmoothing is a statsmodels model class for constructing exponential smoothing models with configurable components such as trend.

ExponentialSmoothing is a statsmodels model class for forecasting time series by emphasizing recent observations and configuring level, trend, and seasonal components. section 7.4.6 section 7.4.7

Choose the configuration according to the patterns present in the series:

  • Use simple exponential smoothing when the series has neither trend nor seasonal patterns. section 7.4.6
  • Add trend='add' for double exponential smoothing, also called Holt’s linear trend model, when the series has a linear trend. section 7.4.6
  • Add seasonal='add' and seasonal_periods for Holt–Winters forecasting when recurring seasonal variation accompanies trend. section 7.4.7

Fit a Holt–Winters model

Fit the model to training data with an additive trend, additive seasonality, and a five-observation seasonal cycle; then inspect AIC and BIC for comparison. section 7.4.7

>>> hw_model = ExponentialSmoothing(train,
>>>                                 trend = 'add',
>>>                                 seasonal = 'add',
>>>                                 seasonal_periods = 5).fit()

Use the listing to see the complete ExponentialSmoothing configuration for trend and seasonal components. section 7.4.7

How Statistics Every Programmer Needs covers it

How deep it goes
Explains SES, DES, and Holt–Winters configurations and compares AIC and BIC, without deriving optimization or smoothing equations.
Examples
Demonstrates training-data fits for SES, DES, and Holt–Winters, including a five-day seasonal cycle and Apple stock closing-price forecasts.
What you can do after
Apply it via statsmodels to fit configurable smoothing models and evaluate fit using AIC and BIC.
How it connects
Connects exponential smoothing with time-series forecasting, trend, seasonality, Holt’s linear trend model, ARIMA, AIC, and BIC.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.