View source: R/methods-fable.R
| SMEDIAN | R Documentation |
Specify a seasonal median benchmark model for use with
fabletools::model().
SMEDIAN(formula, ...)
formula |
A model formula specifying the response and |
... |
Further arguments. |
SMEDIAN() forecasts each future observation using the historical median
of the matching seasonal position. Use the lag() special to define the
seasonal period, for example lag("week") for hourly data with weekly
seasonality.
A model definition that can be used inside fabletools::model().
Other SMEDIAN:
fitted.SMEDIAN(),
forecast.SMEDIAN(),
model_sum.SMEDIAN(),
residuals.SMEDIAN()
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("SMEDIAN" = SMEDIAN(value ~ lag("week")))
model_frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.