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

add forecast_opts() #901

Merged
merged 11 commits into from
Dec 20, 2024
Merged

add forecast_opts() #901

merged 11 commits into from
Dec 20, 2024

Conversation

sbfnk
Copy link
Contributor

@sbfnk sbfnk commented Dec 17, 2024

Description

This PR closes #867 and part of #898 whilst enabling addressing #640.

It introduces a forecast argument to estimate_infections() that is set via forecast_opts() (preferred over add_horizon() as it allows us to identify the last date in the data - though the add_horizon() function exists internally so we could make the switch at a later time if we want).

Initial submission checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have tested my changes locally (using devtools::test() and devtools::check()).
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required and rebuilt docs if yes (using devtools::document()).
  • I have followed the established coding standards (and checked using lintr::lint_package()).
  • I have added a news item linked to this PR.

After the initial Pull Request

  • I have reviewed Checks for this PR and addressed any issues as far as I am able.

Copy link
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 8003d06 is merged into main:

  • ✔️default: 23.5s -> 28.9s [-38.67%, +84.58%]
  • ✔️no_delays: 26.6s -> 29.9s [-0.55%, +24.78%]
  • ✔️random_walk: 9.68s -> 10.2s [-1.38%, +11.95%]
  • ✔️stationary: 13.2s -> 13.8s [-15.75%, +24.17%]
  • ✔️uncertain: 38.6s -> 59.1s [-69.85%, +175.99%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Copy link
Contributor

@jamesmbaazam jamesmbaazam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this, Seb.

I made a few comments and suggestions.

NEWS.md Outdated Show resolved Hide resolved
R/create.R Outdated Show resolved Hide resolved
R/opts.R Show resolved Hide resolved
R/opts.R Outdated Show resolved Hide resolved
R/create.R Outdated Show resolved Hide resolved
R/create.R Show resolved Hide resolved
tests/testthat/test-gp_opts.R Outdated Show resolved Hide resolved
Copy link
Contributor Author

@sbfnk sbfnk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jamesmbaazam. Did the new identification of gaps look OK to you (I think you weren't convinced of the idea in the corresponding Issue)?

if (length(gaps) == 1 && gaps > 1) { ## all gaps are the same

R/create.R Outdated Show resolved Hide resolved
R/create.R Show resolved Hide resolved
R/opts.R Show resolved Hide resolved
R/opts.R Outdated Show resolved Hide resolved
tests/testthat/test-gp_opts.R Outdated Show resolved Hide resolved
@jamesmbaazam
Copy link
Contributor

I agree but - should we then also rename cases_time to case_times?

That would be better too.

@sbfnk sbfnk mentioned this pull request Dec 19, 2024
7 tasks
@jamesmbaazam
Copy link
Contributor

Thanks, @jamesmbaazam. Did the new identification of gaps look OK to you (I think you weren't convinced of the idea in the corresponding Issue)?

I like the current implementation.

@sbfnk sbfnk requested a review from jamesmbaazam December 20, 2024 16:23
@seabbs seabbs enabled auto-merge December 20, 2024 16:25
Copy link
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if f0f453e is merged into main:

  • ✔️default: 19.3s -> 30.7s [-64.27%, +183.1%]
  • ✔️no_delays: 23.4s -> 30.8s [-35.06%, +97.92%]
  • ✔️random_walk: 9.56s -> 9.16s [-12.76%, +4.51%]
  • ✔️stationary: 12.2s -> 11.8s [-16.96%, +8.97%]
  • ✔️uncertain: 33s -> 34.1s [-8.22%, +14.96%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@seabbs seabbs added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit a5da083 Dec 20, 2024
12 of 13 checks passed
@seabbs seabbs deleted the forecast_opts branch December 20, 2024 21:28
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.

forecast_opts() or add_horizon()
3 participants