Extracts the residuals.

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

Arguments

object

A model for which forecasts are required.

...

Other arguments passed to methods

Value

A vector of fitted residuals.

Examples

library(tsibbledata)
vic_elec %>%
  model(avg = MEAN(Demand)) %>%
  residuals()
#> # A tsibble: 52,608 x 3 [30m] <Australia/Melbourne>
#> # Key:       .model [1]
#>    .model Time                .resid
#>    <chr>  <dttm>               <dbl>
#>  1 avg    2012-01-01 00:00:00  -283.
#>  2 avg    2012-01-01 00:30:00  -402.
#>  3 avg    2012-01-01 01:00:00  -616.
#>  4 avg    2012-01-01 01:30:00  -788.
#>  5 avg    2012-01-01 02:00:00  -629.
#>  6 avg    2012-01-01 02:30:00  -800.
#>  7 avg    2012-01-01 03:00:00  -971.
#>  8 avg    2012-01-01 03:30:00 -1104.
#>  9 avg    2012-01-01 04:00:00 -1232.
#> 10 avg    2012-01-01 04:30:00 -1306.
#> # ℹ 52,598 more rows