Baseline Models
Simple benchmark methods for comparison and quick forecasts.
| Model | Description |
|---|---|
Naive | Repeats the last observed value |
SeasonalNaive | Repeats values from previous seasonal cycle |
SMA | Simple Moving Average |
RandomWalkDrift | Random walk with drift (trend) |
Showing 4 of 4
Naive
Repeats the last observed value for all forecast horizons.
Example
SELECT * FROM anofox_fcst_ts_forecast(
'sales_data',
'date',
'sales',
'Naive',
14,
MAP{}
);
Best for: Establishing baseline, random walk data.
SeasonalNaive
Repeats values from the same period in the previous seasonal cycle.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
seasonal_period | INTEGER | Yes | Seasonal period |
Example
-- Weekly seasonality: forecast = same day last week
SELECT * FROM anofox_fcst_ts_forecast(
'weekly_sales',
'date',
'sales',
'SeasonalNaive',
28,
MAP{'seasonal_period': '7'}
);
Best for: Strong seasonal patterns, limited data.
SMA (Simple Moving Average)
Average of the last N observations.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
window | INTEGER | 7 | Number of observations to average |
Example
SELECT * FROM anofox_fcst_ts_forecast(
'noisy_data',
'date',
'value',
'SMA',
14,
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 anofox_fcst_ts_forecast(
'trending_data',
'date',
'value',
'RandomWalkDrift',
28,
MAP{}
);
Best for: Trending data baseline, financial data.
Comparison
| Model | Handles Trend | Handles Seasonality | Speed |
|---|---|---|---|
| Naive | No | No | Fastest |
| SeasonalNaive | No | Yes | Fast |
| SMA | Smoothed | No | Fast |
| RandomWalkDrift | Yes | No | Fast |
When to Use Baseline Models
| Scenario | Recommended |
|---|---|
| Establish performance baseline | Naive |
| Strong weekly/yearly patterns | SeasonalNaive |
| Noisy stationary data | SMA |
| Trending random walk | RandomWalkDrift |
| Very limited data | SeasonalNaive |
| Real-time quick forecast | Naive |
Using Baselines for Comparison
Always compare your sophisticated model against baselines:
-- Compare AutoETS against SeasonalNaive
WITH baseline AS (
SELECT * FROM anofox_fcst_ts_forecast(
'sales', 'date', 'value', 'SeasonalNaive', 28, MAP{'seasonal_period': '7'}
)
),
model AS (
SELECT * FROM anofox_fcst_ts_forecast(
'sales', 'date', 'value', 'AutoETS', 28, MAP{}
)
)
SELECT
anofox_fcst_ts_mase(actual, model_pred, baseline_pred) as mase
FROM comparison_data;
If MASE < 1, your model beats the baseline.