Uses a fitted model to augment the response variable with fitted values and residuals.

# S3 method for mdl_df
augment(x, ...)

# S3 method for mdl_ts
augment(x, ...)

Arguments

x

A mable.

...

Arguments for model methods.

Examples

if (requireNamespace("fable", quietly = TRUE)) { library(fable) library(tsibbledata) # Forecasting with an ETS(M,Ad,A) model to Australian beer production aus_production %>% model(ets = ETS(log(Beer) ~ error("M") + trend("Ad") + season("A"))) %>% augment(type = "response") }
#> Warning: 1 error encountered for ets #> [1] .data contains implicit gaps in time. You should check your data and convert implicit gaps into explicit missing values using `tsibble::fill_gaps()` if required.
#> # A tsibble: 218 x 5 [1Q] #> # Key: .model [1] #> .model Quarter Beer .fitted[,"log(Beer)"] .resid[,"log(Beer)"] #> <chr> <qtr> <dbl> <dbl> <dbl> #> 1 ets 1956-01-01 284. NA NA #> 2 ets 1956-04-01 213. NA NA #> 3 ets 1956-07-01 227. NA NA #> 4 ets 1956-10-01 308. NA NA #> 5 ets 1957-01-01 262. NA NA #> 6 ets 1957-04-01 228. NA NA #> 7 ets 1957-07-01 236. NA NA #> 8 ets 1957-10-01 320. NA NA #> 9 ets 1958-01-01 272. NA NA #> 10 ets 1958-04-01 233. NA NA #> # … with 208 more rows