Extracts the residuals.

# S3 method for NNETAR
residuals(object, ...)

Arguments

object

The time series model used to produce the forecasts

...

Additional arguments for forecast model methods.

Value

A vector of fitted residuals.

Examples

as_tsibble(airmiles) %>% model(nn = NNETAR(box_cox(value, 0.15))) %>% residuals()
#> # A tsibble: 24 x 3 [1Y] #> # Key: .model [1] #> .model index .resid #> <chr> <dbl> <dbl> #> 1 nn 1937 NA #> 2 nn 1938 -0.437 #> 3 nn 1939 0.116 #> 4 nn 1940 0.423 #> 5 nn 1941 0.0550 #> 6 nn 1942 -0.668 #> 7 nn 1943 -0.313 #> 8 nn 1944 0.152 #> 9 nn 1945 0.677 #> 10 nn 1946 1.26 #> # … with 14 more rows