View source: R/methods-fable.R
| MEDIAN | R Documentation |
Specify a median benchmark model for use with fabletools::model().
MEDIAN(formula, ...)
formula |
A model formula specifying the response and optional
|
... |
Further arguments. |
MEDIAN() forecasts future values using the median of the observed
response. The window() special controls whether the median is estimated
using all observations, a fixed trailing window, or a rolling window.
A model definition that can be used inside fabletools::model().
Other MEDIAN:
fitted.MEDIAN(),
forecast.MEDIAN(),
model_sum.MEDIAN(),
residuals.MEDIAN()
library(dplyr)
library(tsibble)
library(fabletools)
train_frame <- M4_monthly_data |>
filter(series == first(series)) |>
as_tsibble(index = index)
model_frame <- train_frame |>
model("MEDIAN" = MEDIAN(value ~ window()))
model_frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.