tidyverts / tidyverts/fable

Bootstrapped innovations with combination models

Open
#347 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
588
Forks
71
Avg merge
1h 58m
Merged PRs (30d)
1

Description

Hi,

I'm encountering an error when trying to generate simulations from a combined model with bootstrapped innovations. Is this normal due to some peculiarities of combination models or is there a bug?

Thank you very much.

x <- tsibble::tourism %>% filter(Region == "Adelaide")

# Working example
fit <- x %>% 
  model(
    ets = ETS(Trips),
    ar = ARIMA(Trips)
  )

sims <- fit %>%
     generate(times = 10, h = 4, bootstrap = T) %>% as_tibble()
# Not working
fit <- x %>% 
  model(
    ets = ETS(Trips),
    ar = ARIMA(Trips)
  ) %>% mutate(comb = (ets + ar)/2)

sims <- fit %>%
     generate(times = 10, h = 4, bootstrap = T) %>% as_tibble()

Erreur dans sample.int(length(x), size, replace, prob) : 
  premier argument incorrect
De plus : Message d'avis :
Dans mean.default(res, na.rm = TRUE) :
  l'argument n'est ni numérique, ni logique : renvoi de NA
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=French_Canada.1252  LC_CTYPE=French_Canada.1252    LC_MONETARY=French_Canada.1252 LC_NUMERIC=C                  
[5] LC_TIME=French_Canada.1252    

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] lubridate_1.7.10  concordance_2.0.0 ggplot2_3.3.5     feasts_0.2.2      vroom_1.5.4       dplyr_1.0.7       fable_0.3.1       fabletools_0.3.1 
 [9] tsibble_1.0.1     stringr_1.4.0    

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7           urca_1.3-0           progressr_0.8.0      pillar_1.6.2         compiler_4.1.0       tools_4.1.0          digest_0.6.27       
 [8] bit_4.0.4            lattice_0.20-44      nlme_3.1-152         lifecycle_1.0.0      tibble_3.1.3         gtable_0.3.0         anytime_0.3.9       
[15] pkgconfig_2.0.3      rlang_0.4.11         cli_3.0.1            withr_2.4.2          generics_0.1.0       vctrs_0.3.8          nnet_7.3-16         
[22] bit64_4.0.5          grid_4.1.0           tidyselect_1.1.1     glue_1.4.2           R6_2.5.0             fansi_0.5.0          distributional_0.2.2
[29] farver_2.1.0         purrr_0.3.4          tidyr_1.1.3          tzdb_0.1.2           magrittr_2.0.1       scales_1.1.1         ellipsis_0.3.2      
[36] colorspace_2.0-2     renv_0.14.0          utf8_1.2.2           stringi_1.7.3        munsell_0.5.0        crayon_1.4.1  

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the provided tourism example and compare bootstrap generation for the separate ETS and ARIMA models with the combined (ets + ar)/2 model. Start at the generate() entry point and trace how bootstrapped innovations are handled for combination models; done means the combined example generates simulations without the reported error, or the limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
analytics, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.