Skip to main content

Baseline Models

Simple benchmark methods for comparison and quick forecasts.

ModelDescription
NaiveRepeats the last observed value
SeasonalNaiveRepeats values from previous seasonal cycle
SMASimple Moving Average
RandomWalkDriftRandom walk with drift (trend)
Showing 4 of 4

Naive

Repeats the last observed value for all forecast horizons.

Example

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

Best for: Establishing baseline, random walk data.


SeasonalNaive

Repeats values from the same period in the previous seasonal cycle.

Parameters

ParameterTypeRequiredDescription
seasonal_periodINTEGERYesSeasonal period

Example

-- Weekly seasonality: forecast = same day last week
SELECT * FROM ts_forecast_by(
'weekly_sales', NULL, date, sales,
'SeasonalNaive', 28, '1d',
MAP{'seasonal_period': '7'}
);

Best for: Strong seasonal patterns, limited data.


SMA (Simple Moving Average)

Average of the last N observations.

Parameters

ParameterTypeDefaultDescription
windowINTEGER5Number of observations to average

Example

SELECT * FROM ts_forecast_by(
'noisy_data', NULL, date, value,
'SMA', 14, '1d',
MAP{'window': '7'}
);

Best for: Smoothing noise, simple baseline.


RandomWalkDrift

Random walk with drift (trend). Adds average historical change to the last value.

Example

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

Best for: Trending data baseline, financial data.


Comparison

ModelHandles TrendHandles SeasonalitySpeed
NaiveNoNoFastest
SeasonalNaiveNoYesFast
SMASmoothedNoFast
RandomWalkDriftYesNoFast

When to Use Baseline Models

ScenarioRecommended
Establish performance baselineNaive
Strong weekly/yearly patternsSeasonalNaive
Noisy stationary dataSMA
Trending random walkRandomWalkDrift
Very limited dataSeasonalNaive
Real-time quick forecastNaive

Using Baselines for Comparison

Always compare your sophisticated model against baselines:

-- Compare AutoETS against SeasonalNaive
CREATE TABLE baseline AS
SELECT * FROM ts_forecast_by(
'sales', NULL, date, value,
'SeasonalNaive', 28, '1d',
MAP{'seasonal_period': '7'}
);

CREATE TABLE model_forecast AS
SELECT * FROM ts_forecast_by(
'sales', NULL, date, value,
'AutoETS', 28, '1d',
MAP{}
);

-- Calculate MASE (< 1 means model beats baseline)
SELECT ts_mase(
LIST(actual ORDER BY date),
LIST(model_pred ORDER BY date),
LIST(baseline_pred ORDER BY date)
) AS mase
FROM comparison_data;

If MASE < 1, your model beats the baseline.

🍪 Cookie Settings