Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refitted model with reconcile() cannot be forecasted #251

Closed
jy-r opened this issue Aug 8, 2020 · 1 comment
Closed

Refitted model with reconcile() cannot be forecasted #251

jy-r opened this issue Aug 8, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jy-r
Copy link

jy-r commented Aug 8, 2020

After the model is refitted with refit() on new data, it seems to lose attributes method and sparse which causes error in forecast.lst_mint_mdl here . The problem appears to be in refit.mdl_df, where the attributes are lost.

library(tsibble)
library(fabletools)
library(fable)
lung_deaths_agg <- 	as_tsibble(cbind(mdeaths, fdeaths)) %>%
  aggregate_key(key, value = sum(value))

fit <- lung_deaths_agg %>%
  model(lm = TSLM(value ~ trend() + season())) %>%
  reconcile(lm = min_trace(lm)) 

fit_refit <- fit %>% refit(lung_deaths_agg)

fit %>% forecast()
fit_refit %>% forecast()
Error: Problem with `mutate()` input `lm`.
✖ argument is of length zero
ℹ Input `lm` is `(function (object, ...) ...`.
Run `rlang::last_error()` to see where the error occurred.
@mitchelloharawild mitchelloharawild self-assigned this Aug 9, 2020
@mitchelloharawild mitchelloharawild added the bug Something isn't working label Aug 9, 2020
@mitchelloharawild
Copy link
Member

mitchelloharawild commented Aug 26, 2020

Fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants