fable
fable copied to clipboard
Bootstrapped innovations with combination models
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