SNAIVE2: Seasonal naive model with weekday-specific lags

View source: R/methods-fable.R

SNAIVE2R Documentation

Seasonal naive model with weekday-specific lags

Description

Specify a seasonal naive benchmark model for use with fabletools::model().

Usage

SNAIVE2(formula, ...)

Arguments

formula

A model formula specifying the response variable, for example value.

...

Further arguments.

Details

SNAIVE2() is intended for hourly time series. It uses a daily lag for Tuesday to Friday observations and a weekly lag otherwise. This can be useful for electricity price or load data where weekdays have similar intraday structure and weekends require a weekly comparison.

Value

A model definition that can be used inside fabletools::model().

See Also

Other SNAIVE2: fitted.SNAIVE2(), forecast.SNAIVE2(), model_sum.SNAIVE2(), residuals.SNAIVE2()

Examples

library(dplyr)
library(tsibble)
library(fabletools)

train_frame <- elec_price |>
  filter(bidding_zone == "DE") |>
  slice_head(n = 24 * 21) |>
  as_tsibble(index = time)

model_frame <- train_frame |>
  model("SNAIVE2" = SNAIVE2(value))

model_frame

tscv documentation built on May 13, 2026, 9:07 a.m.