A seasonal naïve model forecasts each future value by repeating the observation from the same position in the previous seasonal cycle. With daily data and weekly seasonality, a seven-day history becomes the forecast for the next seven days. section 10.2.2
The model serves as a fast baseline rather than a trained forecasting system: it uses the last seven values directly, so inference requires no parameter fitting. Cross-validation can compare it with more advanced models using nonoverlapping forecast windows. section 10.1 section 10.2.2
A practical setup uses:
- A seasonal period of 7 for daily observations with weekly seasonality. section 10.2.2
- statsforecast's SeasonalNaive model with cross_validation configured for the forecast horizon and nonoverlapping windows. section 10.2.2
- MAE and sMAPE for evaluating baseline forecasts against competing models. section 10.1
Listing 10.4 Baseline forecasts
from statsforecast import StatsForecast
from statsforecast.models import SeasonalNaive #1
baseline_model = SeasonalNaive(season_length=7) #2
sf = StatsForecast(
models=[baseline_model],
freq=FREQ) #3
init = time() #4
baseline_cv_fcsts = sf.cross_validation(
h=HORIZON,
df=df,
n_windows=N_WINDOWS,
step_size=HORIZON #5
)
print(f"Baseline time: {time() - init} seconds") #6
baseline_cv_fcsts.to_csv
➥("baseline_preds.csv", header=True, index=False) #7
The implementation initializes SeasonalNaive with season_length=7 and produces cross-validated baseline forecasts with statsforecast. section 10.2.2
