Extracts the residuals.

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

Arguments

object

A model for which forecasts are required.

...

Other arguments passed to methods

Value

A vector of fitted residuals.

Examples

as_tsibble(USAccDeaths) %>%
  model(ets = ETS(log(value) ~ season("A"))) %>%
  residuals()
#> # A tsibble: 72 x 3 [1M]
#> # Key:       .model [1]
#>    .model    index   .resid
#>    <chr>     <mth>    <dbl>
#>  1 ets    1973 Jan  0.00461
#>  2 ets    1973 Feb -0.00109
#>  3 ets    1973 Mar -0.00538
#>  4 ets    1973 Apr -0.00496
#>  5 ets    1973 May -0.00587
#>  6 ets    1973 Jun  0.0270 
#>  7 ets    1973 Jul -0.0269 
#>  8 ets    1973 Aug  0.00863
#>  9 ets    1973 Sep  0.0196 
#> 10 ets    1973 Oct  0.00108
#> # ℹ 62 more rows