Skip to main content

Theta Methods

Decomposition-based forecasting. 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 anofox_fcst_ts_forecast(
'sales_data',
'date',
'sales',
'Theta',
14,
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 anofox_fcst_ts_forecast(
'sales_data',
'date',
'sales',
'AutoTheta',
14,
MAP{}
);

Best for: Short-term forecasts with automatic optimization.


OptimizedTheta

Theta method with optimized decomposition parameters.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM anofox_fcst_ts_forecast(
'sales_data',
'date',
'sales',
'OptimizedTheta',
14,
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 anofox_fcst_ts_forecast(
'changing_data',
'date',
'value',
'DynamicTheta',
28,
MAP{}
);

Best for: Series with changing patterns over time.


DynamicOptimizedTheta

Combines dynamic and optimized Theta approaches.

Parameters

ParameterTypeDefaultDescription
seasonal_periodINTEGERautoSeasonal period

Example

SELECT * FROM anofox_fcst_ts_forecast(
'complex_data',
'date',
'value',
'DynamicOptimizedTheta',
28,
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(
'sales_data', date, sales,
'temperature',
'future_exog',
'ThetaX', 3, MAP{}
);

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

See Exogenous Variables for detailed usage

🍪 Cookie Settings