residuals.MEDIAN: Extract residuals from a median model

View source: R/methods-fable.R

residuals.MEDIANR Documentation

Extract residuals from a median model

Description

Extract residuals from a fitted MEDIAN model.

Usage

## S3 method for class 'MEDIAN'
residuals(object, ...)

Arguments

object

A fitted MEDIAN model object.

...

Additional arguments. Currently not used.

Value

Residuals.

See Also

Other MEDIAN: MEDIAN(), fitted.MEDIAN(), forecast.MEDIAN(), model_sum.MEDIAN()

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("MEDIAN" = MEDIAN(value ~ window()))

residuals(model_frame)

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