fable icon indicating copy to clipboard operation
fable copied to clipboard

Add multi-step fitted value methods for TSLM and others

Open robjhyndman opened this issue 3 years ago • 1 comments

Reported at https://stackoverflow.com/q/70782047/144157

library(fable)
#> Loading required package: fabletools

model_fit <- tsibbledata::aus_production %>% 
  model(mod = TSLM(Beer ~ Gas + trend()))

fitted(model_fit, h = 2)
#> # A tsibble: 218 x 3 [1Q]
#> # Key:       .model [1]
#>    .model Quarter .fitted
#>    <chr>    <qtr>   <dbl>
#>  1 mod    1956 Q1      NA
#>  2 mod    1956 Q2      NA
#>  3 mod    1956 Q3      NA
#>  4 mod    1956 Q4      NA
#>  5 mod    1957 Q1      NA
#>  6 mod    1957 Q2      NA
#>  7 mod    1957 Q3      NA
#>  8 mod    1957 Q4      NA
#>  9 mod    1958 Q1      NA
#> 10 mod    1958 Q2      NA
#> # … with 208 more rows

Created on 2022-01-21 by the reprex package (v2.0.1)

robjhyndman avatar Jan 20 '22 22:01 robjhyndman

Not yet implemented for TSLM. Migrating to {fable}.

library(fable)
#> Loading required package: fabletools
#> Warning: package 'fabletools' was built under R version 4.0.4
methods("hfitted")
#> [1] hfitted.ARIMA*  hfitted.ETS*    hfitted.mdl_ts*
#> see '?methods' for accessing help and source code

Created on 2022-01-21 by the reprex package (v2.0.1)

mitchelloharawild avatar Jan 20 '22 22:01 mitchelloharawild