Extract residuals from a fitted NAIVE2 model.
Usage
# S3 method for class 'NAIVE2'
residuals(object, ...)See also
Other NAIVE2:
NAIVE2(),
fitted.NAIVE2(),
forecast.NAIVE2(),
model_sum.NAIVE2()
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("NAIVE2" = NAIVE2(value ~ season(12)))
residuals(model_frame)
#> # A tsibble: 450 x 3 [1M]
#> # Key: .model [1]
#> .model index .resid
#> <chr> <mth> <dbl>
#> 1 NAIVE2 1978 Feb NA
#> 2 NAIVE2 1978 Mrz -8.55
#> 3 NAIVE2 1978 Apr 18.0
#> 4 NAIVE2 1978 Mai -21.8
#> 5 NAIVE2 1978 Jun -19.9
#> 6 NAIVE2 1978 Jul 9.29
#> 7 NAIVE2 1978 Aug 54.5
#> 8 NAIVE2 1978 Sep 9.86
#> 9 NAIVE2 1978 Okt 20.8
#> 10 NAIVE2 1978 Nov -58.1
#> # ℹ 440 more rows
