Open shelby-mcneill-domo opened 1 year ago
The following code doesn't automatically back transform a box_cox transformation when generating coherent forecasts using reconcile():
library(fable) library(dplyr) library(feasts) library(tsibble) UKLungDeaths <- as_tsibble(cbind(mdeaths, fdeaths), pivot_longer = TRUE) UKLungDeaths_gts <- UKLungDeaths |> aggregate_key(key, value = sum(value)) lambda <- UKLungDeaths_gts |> features(value, features = guerrero) train_data <- UKLungDeaths_gts |> left_join(lambda, by = "key") test_data <- new_data(UKLungDeaths_gts, 12) %>% left_join(lambda) train_data |> model(base = ETS(box_cox(value, lambda_guerrero))) |> reconcile( bottom_up = bottom_up(base), MinT = min_trace(base, method = "mint_shrink") ) |> forecast(test_data)
Snippet of forecast output:
I also tried setting the transformation to use only the first value of lambda, as mentioned in #103, but get the following error:
train_data |> model(base = ETS(box_cox(value, first(lambda_guerrero)))) |> reconcile( bottom_up = bottom_up(base), MinT = min_trace(base, method = "mint_shrink") ) |> forecast(test_data) Error in `mutate()`: ℹ In argument: `MinT = (function (object, ...) ...`. Caused by error in `vec_size()`: ! object 'lambda_guerrero' not found
Thank you!
The following code doesn't automatically back transform a box_cox transformation when generating coherent forecasts using reconcile():
Snippet of forecast output:
I also tried setting the transformation to use only the first value of lambda, as mentioned in #103, but get the following error:
Thank you!