The augment() function returns the data used in the model
# S3 method for hts_inla
augment(x, newdata = NULL, exponentiate = FALSE, ...)object of class "hts_inla"
new data to pass to prediction? Default is NULL
default FALSE. Whether to exponentiate predictions
extra arguments to pass to augment(). Currently unused.
dataframe with column names of original data, as well as extra columns, ".fitted" and ".resid".
hts_example_model
#> <hts_inla> model (fit in 26.49s)
#> Formula:
#> • ~
#> • pr
#> • avg_lower_age + hts(who_subregion, country)
#>
augment(hts_example_model)
#> # A tsibble: 1,046 x 19 [1D]
#> # Key: country [46]
#> who_region who_subregion country date month_num positive examined
#> <fct> <fct> <fct> <date> <dbl> <dbl> <int>
#> 1 AFRO AFRO-W Angola 1989-06-01 120 15.8 50
#> 2 AFRO AFRO-W Angola 2005-11-01 372 82 111
#> 3 AFRO AFRO-W Angola 2006-04-01 300 102 197
#> 4 AFRO AFRO-W Angola 2006-11-01 384 41 347
#> 5 AFRO AFRO-W Angola 2006-12-01 396 173 734
#> 6 AFRO AFRO-W Angola 2007-01-01 276 216 828
#> 7 AFRO AFRO-W Angola 2007-02-01 288 42 71
#> 8 AFRO AFRO-W Angola 2007-03-01 300 119 448
#> 9 AFRO AFRO-W Angola 2011-01-01 324 1 239
#> 10 AFRO AFRO-W Angola 2011-02-01 336 148 1132
#> # … with 1,036 more rows, and 12 more variables: pr <dbl>, avg_lower_age <dbl>,
#> # continent_id <fct>, country_id <fct>, year <int>, month <int>,
#> # avg_upper_age <dbl>, species <fct>, .who_subregion_id <int>,
#> # .country_id <int>, .fitted <dbl>, .resid <dbl>