Skip to content

Refitted model with reconcile() cannot be forecasted #251

Closed

Description

@jy-r

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.

Activity

  1. mitchelloharawild commented on Aug 26, 2020

    @mitchelloharawild
    Member

    Fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions