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

Added faster and better hfitted method for ETS model #950

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

mitchelloharawild
Copy link
Collaborator

Much like #949, I have a faster version of multi-step fitted values for ETS which I have incorporated here. It additionally uses the initial states to produce a h-step fit at time h-1.

devtools::load_all("~/github/forecast/")
#> ℹ Loading forecast
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
fit <- ets(USAccDeaths)
bench::mark(
  forecast:::hfitted.default(fit, 4),
  hfitted(fit, 4),
  check = FALSE
)
#> # A tibble: 2 × 6
#>   expression                           min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr>                      <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 forecast:::hfitted.default(fit… 106.88ms 106.88ms      9.36    6.23MB     37.4
#> 2 hfitted(fit, 4)                   1.15ms   1.23ms    769.        624B     13.0

Created on 2023-12-27 with reprex v2.0.2

@robjhyndman robjhyndman merged commit 208768a into robjhyndman:master Mar 1, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants