View source: R/methods-fable.R
| SNAIVE2 | R Documentation |
Specify a seasonal naive benchmark model for use with
fabletools::model().
SNAIVE2(formula, ...)
formula |
A model formula specifying the response variable, for example
|
... |
Further arguments. |
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.
A model definition that can be used inside fabletools::model().
Other SNAIVE2:
fitted.SNAIVE2(),
forecast.SNAIVE2(),
model_sum.SNAIVE2(),
residuals.SNAIVE2()
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.