SMEAN: Seasonal mean model

View source: R/methods-fable.R

SMEANR Documentation

Seasonal mean model

Description

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

Usage

SMEAN(formula, ...)

Arguments

formula

A model formula specifying the response and lag() special, for example value ~ lag("year").

...

Further arguments.

Details

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.

Value

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

See Also

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

Examples

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

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