Exponential Smoothing Forecast

Forecast every asset with exponential smoothing or the Theta method: a weighted average of its past values, with weights that fall off exponentially, extended with a trend and a season, and the prediction interval around it.

Exponential smoothing and the Theta method are robust baselines: in the M3 forecasting competition (Makridakis and Hibon, 2000) the Theta method was the most accurate, and damped trend smoothing is hard to beat on business and economic series. The smoothing methods are fitted as ETS state space models with additive errors (Hyndman, Koehler, Ord and Snyder, 2008) by Maximum Likelihood, which gives their prediction intervals in closed form; the Theta method’s interval is that of simple exponential smoothing with drift.

The formula for simple exponential smoothing is as follows:

\[\hat{y}_{t+h} = \ell_{t}\] \[\ell_{t} = \alpha \cdot y_{t} + (1 - \alpha) \cdot \ell_{t-1}\]

with \(y_{t}\) the column series (Adj Close by default).

The formula for Holt’s linear trend is as follows:

\[\hat{y}_{t+h} = \ell_{t} + h \cdot b_{t}\] \[\ell_{t} = \alpha \cdot y_{t} + (1 - \alpha) \cdot (\ell_{t-1} + b_{t-1})\] \[b_{t} = \beta \cdot (\ell_{t} - \ell_{t-1}) + (1 - \beta) \cdot b_{t-1}\]

The formula for the damped trend (Gardner and McKenzie, 1985) is as follows:

\[\hat{y}_{t+h} = \ell_{t} + \sum_{i=1}^{h} \phi^{i} \cdot b_{t}\]

with the trend fading by phi (\(0 < \phi < 1\)) per period.

The formula for Holt-Winters (additive season) is as follows:

\[\hat{y}_{t+h} = \ell_{t} + h \cdot b_{t} + s_{t+h-m}\] \[s_{t} = \gamma \cdot (y_{t} - \ell_{t-1} - b_{t-1}) + (1 - \gamma) \cdot s_{t-m}\]

with m the periods in a season; the seasonal states start from a classical decomposition of the first years (the heuristic of Hyndman et al., 2008).

The formula for the Theta method (Assimakopoulos and Nikolopoulos, 2000) is as follows:

\[\hat{y}_{t+h} = \ell_{t} + \frac{b_{0} \cdot \left(h - 1 + \frac{1}{\alpha} - \frac{(1 - \alpha)^{t}}{\alpha}\right)}{2}\]

the simple exponential smoothing forecast plus half the slope \(b_{0}\) of a linear trend fitted by least squares, simple exponential smoothing with drift (Hyndman and Billah, 2003); the series is deseasonalized first (by a classical decomposition, multiplicative for positive data) when the autocorrelation at the season is significant at 10%, and reseasonalized after.

The parameters \(\alpha\), \(\beta\), \(\gamma\) and \(\phi\) and the initial states are fitted by Maximum Likelihood (statsmodels ETSModel and ThetaModel), and the Lower and Upper Bound are the prediction interval at confidence (95% by default).

Also known as: ETS, exponential smoothing, simple exponential smoothing, SES, Holt, Holt-Winters, damped trend, Theta method, baseline forecast.

Example · AAPL, MSFT · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_exponential_smoothing_forecast:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.econometrics.get_exponential_smoothing_forecast(method="damped")["AAPL"]

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

What is the damped trend exponential smoothing forecast of Apple's share price for the next five trading days after 2025, with its confidence band, on data from 2021?

Which returns:

Using Your Own Data

get_exponential_smoothing_forecast runs on any data, not only prices: ratios, economic indicators, yield curves or your own dataset. Pass a DataFrame, a Series or a dictionary of them to Econometrics as data, with the dates in the rows or the columns, and set changes to how its changes are calculated: "percentage", "log", "difference" for rates and ratios, or None when the data are changes already. For example, for the monthly unemployment rates of the United States and Germany:

from financetoolkit import Economics, Econometrics

economics = Economics(start_date="2000-01-01")

unemployment = economics.get_unemployment_rate(
    countries=["United States", "Germany"], period="monthly"
)

econometrics = Econometrics(data=unemployment, changes="difference")

econometrics.get_exponential_smoothing_forecast()

Parameters

get_exponential_smoothing_forecast accepts the following parameters.

ParameterTypeDescriptionExample
methodstrThe method. Options are: “simple” (simple exponential smoothing), “holt” (Holt’s linear trend), “damped” (damped trend), “holt_winters” (Holt-Winters additive season), “theta” (Theta method). Defaults to “simple”."simple"
periodstrThe data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”."weekly"
columnstrThe historical data column to forecast. Defaults to “Adj Close”."Return"
forecast_stepsintThe number of periods ahead to forecast. Defaults to 5.10
seasonal_periodsint | NoneThe periods in a season of the Holt-Winters and Theta methods. Defaults to None, which takes a year of observations from the spacing of the dates (252 trading days, 52 weeks, 12 months, 4 quarters).None, which takes a year of observations from the spacing of the dates (252 trading days, 52 weeks, 12 months, 4 quarters)
confidencefloatThe confidence of the prediction interval. Defaults to 0.95.0.95
include_benchmarkboolWhether to include “Benchmark” among the assets. Defaults to False.True
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Hyndman, R.J., Koehler, A.B., Ord, J.K. and Snyder, R.D. (2008). “Forecasting with Exponential Smoothing: The State Space Approach.” Springer.
  • Paper Gardner, E.S. and McKenzie, E. (1985). “Forecasting Trends in Time Series.” Management Science, 31(10), 1237-1246.
  • Paper Assimakopoulos, V. and Nikolopoulos, K. (2000). “The theta model: a decomposition approach to forecasting.” International Journal of Forecasting, 16(4), 521-530.
  • Paper Hyndman, R.J. and Billah, B. (2003). “Unmasking the Theta method.” International Journal of Forecasting, 19(2), 287-290.
  • Library Shares similar logic as statsmodels’ ETSModel
  • Library Shares similar logic as statsmodels’ ThetaModel
Share