Theta Method
The Theta Method of Assimakopoulos and Nikolopoulos (2000) splits a series into lines of different curvature, the theta lines, forecasts each and combines them. Hyndman and Billah (2003) showed that its standard form is the Simple Exponential Smoothing with a drift of half the slope of a straight line fitted to the series. It was the most accurate method of the M3 forecasting competition (Makridakis and Hibon, 2000).
The formula for the Theta Method smooths the series \(y_{t}\) with Simple Exponential Smoothing into the level ell_t, with alpha between 0 and 1:
\[\ell_{t} = \alpha \cdot y_{t} + (1 - \alpha) \cdot \ell_{t-1}\]The forecast h periods ahead adds half the slope \(b_{0}\) of a straight line fitted to the series by least squares, with a correction for the t values the smoothing started from:
\[\hat{y}_{t+h} = \ell_{t} + \frac{b_{0} \cdot \left(h - 1 + \frac{1}{\alpha} - \frac{(1 - \alpha)^{t}}{\alpha}\right)}{2}\]The forecast rises or falls with the average slope of the whole sample, so it continues a long trend but reacts slowly when the trend turns. A seasonal series is deseasonalized before the fit and reseasonalized after.
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 forecasts a series with a weighted average of its past values whose weights fall off exponentially with their age, so the latest values count most and old ones fade without ever being cut off. It was developed in the 1950s for inventory and sales forecasting, where it needed little computation and adapted to changes in the level of demand. The methods differ in the parts they track: a level, a trend, a trend that fades and a seasonal pattern. Each is fitted here as a state space model with additive errors (Hyndman, Koehler, Ord and Snyder, 2008) by maximum likelihood, which gives the smoothing parameters and a prediction interval around the forecast that widens with the horizon. Exponential smoothing and the Theta Method serve as baselines that a more elaborate model has to beat. For the price of a liquid asset, which is close to a random walk, the forecasts say little beyond the last price: the prediction interval is the more informative part.
Also known as: Theta model, simple exponential smoothing with drift.
In the Finance Toolkit this is get_exponential_smoothing_forecast with method="theta", the same function as Exponential Smoothing 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="theta")["AAPL"]
| Parameter | Type | Description | Example |
|---|---|---|---|
method | str | The method. Options are: “simple” (Simple Exponential Smoothing, a level), “holt” (Holt Linear Trend Method, a level and a trend), “damped” (Damped Trend Method, a trend that fades), “holt_winters” (Holt-Winters Method, a level, a trend and an additive season), “theta” (Theta Method, smoothing with drift). Defaults to “simple”. | "simple" |
period | str | The data frequency (daily, weekly, monthly, quarterly, or yearly). Defaults to “daily”. | "weekly" |
column | str | The historical data column to forecast. Defaults to “Adj Close”. | "Return" |
forecast_steps | int | The number of periods ahead to forecast. Defaults to 5. | 10 |
seasonal_periods | int | None | The 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) |
confidence | float | The confidence of the prediction interval. Defaults to 0.95. | 0.95 |
include_benchmark | bool | Whether to include “Benchmark” among the assets. Defaults to False. | True |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
show_columns | str | list[str] | None | The 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 |
Which returns:
| Step | Forecast | Lower Bound | Upper Bound |
|---|---|---|---|
| 1 | 270.966 | 264.963 | 276.968 |
| 2 | 271.015 | 262.526 | 279.504 |
| 3 | 271.064 | 260.667 | 281.461 |
| 4 | 271.113 | 259.108 | 283.119 |
| 5 | 271.163 | 257.740 | 284.585 |
5 rows
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()
References
- 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.
- Paper Makridakis, S. and Hibon, M. (2000). “The M3-Competition: results, conclusions and implications.” International Journal of Forecasting, 16(4), 451-476.
- Library Shares similar logic as statsmodels’ ThetaModel (Theta Method)