Skip to content

Naive Methods

Baseline forecasting methods useful as benchmarks.


Naive

Forecasts are equal to the last observed value (random walk without drift).

from durbyn import Naive

model = Naive().fit(y, m=12)
fc = model.forecast(h=12, level=[80, 95])

Parameters

Parameter Type Default Description
lambda_ float \| str \| None None Box-Cox parameter
biasadj bool False Bias adjustment for Box-Cox

SeasonalNaive

Forecasts are equal to the last observed value from the same season.

from durbyn import SeasonalNaive

model = SeasonalNaive().fit(y, m=12)
fc = model.forecast(h=24, level=[80, 95])

Parameters

Parameter Type Default Description
lambda_ float \| str \| None None Box-Cox parameter
biasadj bool False Bias adjustment for Box-Cox

Note

The seasonal period m passed to .fit() determines the seasonal cycle length.


RandomWalk

Random walk forecast with optional drift.

from durbyn import RandomWalk

# Without drift
model = RandomWalk().fit(y, m=1)
fc = model.forecast(h=12)

# With drift (average change per period)
model = RandomWalk(drift=True).fit(y, m=1)
fc = model.forecast(h=12, level=[80, 95])

Parameters

Parameter Type Default Description
drift bool False Include drift term
lambda_ float \| str \| None None Box-Cox parameter
biasadj bool False Bias adjustment for Box-Cox

MeanForecast

Forecasts equal to the mean of the historical data.

from durbyn import MeanForecast

model = MeanForecast().fit(y, m=1)
fc = model.forecast(h=12, level=[80, 95])

Parameters

Parameter Type Default Description
lambda_ float \| str \| None None Box-Cox parameter
biasadj bool False Bias adjustment for Box-Cox

Using Naive Methods as Benchmarks

Naive methods are commonly used as baselines for model comparison:

from durbyn import SES, AutoARIMA, Naive, SeasonalNaive, compare

y_train = y[:24]
y_test = y[24:]

result = compare(
    models={
        "Naive": Naive(),
        "SNaive": SeasonalNaive(),
        "SES": SES(),
        "AutoARIMA": AutoARIMA(),
    },
    y_train=y_train,
    y_test=y_test,
    m=12,
)

print(result.to_dataframe())