Skip to main content

Theta Methods

AnoFox implements 6 Theta variants -- from the classic Theta method to DynamicOptimizedTheta and ThetaX with exogenous variable support. The Theta method gained prominence by winning the M3 forecasting competition, demonstrating that a simple decomposition approach can outperform complex statistical models on diverse datasets. In AnoFox, AutoTheta is the recommended production choice, while ThetaX extends the family with external predictor support via ts_forecast_exog_by.

The Theta method is a decomposition-based forecasting approach that separates a time series into two "theta lines" -- one capturing long-term trend and the other capturing short-term behavior -- then extrapolates and recombines them. It is known for winning the M3 forecasting competition.

ModelDescription
ThetaClassic Theta method
AutoThetaAutomatic Theta with optimized parameters
OptimizedThetaTheta with optimized decomposition parameters
DynamicThetaTheta with time-varying parameters
DynamicOptimizedThetaDynamic + optimized Theta
ThetaXTheta with exogenous variables
Showing 6 of 6

Theta

Classic Theta method that decomposes series into two theta lines and extrapolates.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM ts_forecast_by(
'sales_data', NULL, date, sales,
'Theta', 14, '1d',
MAP{}
);

Best for: Short-term forecasts, simple + fast, competition-winning accuracy.


AutoTheta

Automatic Theta method with optimized parameters.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM ts_forecast_by(
'sales_data', NULL, date, sales,
'AutoTheta', 14, '1d',
MAP{}
);

Best for: Short-term forecasts with automatic optimization.


OptimizedTheta

Theta method with optimized decomposition parameters.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM ts_forecast_by(
'sales_data', NULL, date, sales,
'OptimizedTheta', 14, '1d',
MAP{}
);

Best for: Better accuracy than basic Theta through parameter optimization.


DynamicTheta

Theta method with time-varying parameters.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM ts_forecast_by(
'changing_data', NULL, date, value,
'DynamicTheta', 28, '1d',
MAP{}
);

Best for: Series with changing patterns over time.


DynamicOptimizedTheta

Combines dynamic and optimized Theta approaches.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM ts_forecast_by(
'complex_data', NULL, date, value,
'DynamicOptimizedTheta', 28, '1d',
MAP{}
);

Best for: Maximum Theta accuracy with dynamic adaptation.


Comparison

ModelSpeedOptimizationBest Use Case
ThetaFastNoneQuick baseline
AutoThetaFastAutomaticGeneral purpose
OptimizedThetaFastParametersBetter accuracy
DynamicThetaMediumTime-varyingChanging patterns
DynamicOptimizedThetaMediumBothMaximum accuracy

When to Use Theta Methods

ScenarioRecommended
Quick forecast neededTheta
Production systemAutoTheta
Maximum accuracyDynamicOptimizedTheta
Changing patternsDynamicTheta
Limited dataTheta
External predictorsThetaX

ThetaX

Theta method with exogenous (external) variables. Combines Theta's simplicity with external predictor support.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

-- Create future exogenous values
CREATE TABLE future_exog AS
SELECT * FROM (VALUES
('2024-01-08'::DATE, 22.0),
('2024-01-09'::DATE, 20.0),
('2024-01-10'::DATE, 21.0)
) AS t(date, temperature);

-- Forecast with exogenous variables
SELECT * FROM ts_forecast_exog_by(
'sales_data', NULL, date, sales,
['temperature'],
'future_exog', date, ['temperature'],
'ThetaX', 3,
MAP{}, '1d'
);

Best for: Short-term forecasts with external drivers, simple models with predictor support.

The 5 Theta variants without exogenous support (Theta, AutoTheta, OptimizedTheta, DynamicTheta, DynamicOptimizedTheta) offer a speed-accuracy tradeoff: the basic Theta model is one of the fastest forecasters in the AnoFox library, while DynamicOptimizedTheta provides maximum accuracy at moderate computational cost. For series with limited historical data, the classic Theta method is particularly effective because it requires fewer observations to produce stable forecasts compared to ARIMA or TBATS.

See Exogenous Variables for detailed usage


Frequently Asked Questions

Why did Theta win the M3 competition if it is so simple?

The Theta method succeeds because it effectively decomposes a series into a dampened trend component and a short-term component, then recombines them. The classic Theta method is equivalent to simple exponential smoothing with drift. Its strength lies in this simplicity -- it avoids overfitting that plagues more complex models on short or noisy series.

What is the difference between OptimizedTheta and DynamicTheta?

OptimizedTheta optimizes the decomposition parameters (theta coefficient) to minimize forecast error but keeps parameters fixed over time. DynamicTheta allows parameters to vary over time to adapt to changing patterns. DynamicOptimizedTheta combines both approaches for maximum accuracy at moderate computational cost.

How much data does Theta need compared to ARIMA?

Theta requires less historical data than ARIMA. The basic Theta method can produce stable forecasts with as few as 10-15 observations, whereas ARIMA typically needs at least 30-50 (more for seasonal variants). This makes Theta an excellent choice for new products or short time series.


🍪 Cookie Settings