View source: R/methods-fable.R
| SMEAN | R Documentation |
Specify a seasonal mean benchmark model for use with
fabletools::model().
SMEAN(formula, ...)
formula |
A model formula specifying the response and |
... |
Further arguments. |
SMEAN() forecasts each future observation using the historical mean of
the matching seasonal position. Use the lag() special to define the
seasonal period, for example lag("year") for monthly data.
A model definition that can be used inside fabletools::model().
Other SMEAN:
fitted.SMEAN(),
forecast.SMEAN(),
model_sum.SMEAN(),
residuals.SMEAN()
library(dplyr)
library(tsibble)
library(fabletools)
train_frame <- M4_monthly_data |>
filter(series == first(series)) |>
as_tsibble(index = index)
model_frame <- train_frame |>
model("SMEAN" = SMEAN(value ~ lag("year")))
model_frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.