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

Fit EpiNow2 model #26

Merged
merged 11 commits into from
Sep 12, 2024
Merged

Fit EpiNow2 model #26

merged 11 commits into from
Sep 12, 2024

Conversation

zsusswein
Copy link
Collaborator

@zsusswein zsusswein commented Sep 5, 2024

Take in-memory data, parameters, and sampler settings and fit an EpiNow2 model.

This model recapitulates our existing approach. It continues to be careful to avoid several of our key bugs from the last year:

  • We strip the dataframe down to the minimal needed columns with the appropriate names before calling epinow()
  • It doesn't allow a right-truncation PMF longer than the data
  • It forces the random seed to be used both within R and by Stan, so initialization and the MCMC sampler are deterministic

I also downgrade model fitting failure to a warning here from an error. This is to enable metadata/output writing despite model failure.

@zsusswein zsusswein force-pushed the zs-fit-model branch 3 times, most recently from 62786bf to b108dbd Compare September 10, 2024 20:23
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files

📢 Thoughts on this report? Let us know!

DESCRIPTION Show resolved Hide resolved
@zsusswein zsusswein marked this pull request as ready for review September 10, 2024 21:06
Copy link
Collaborator

@kgostic kgostic left a comment

Choose a reason for hiding this comment

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

Minor comments mostly on documentation, but this looks good and the code is clean! Excited to see this go!

DESCRIPTION Show resolved Hide resolved
R/fit_model.R Outdated Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
R/fit_model.R Outdated Show resolved Hide resolved
R/fit_model.R Outdated Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
tests/testthat/test-fit_model.R Show resolved Hide resolved
tests/testthat/test-fit_model.R Show resolved Hide resolved
tests/testthat/test-fit_model.R Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
zsusswein and others added 2 commits September 10, 2024 19:29
Co-authored-by: Katie Gostic (she/her) <uep6@cdc.gov>
@zsusswein

This comment was marked as resolved.

R/fit_model.R Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
R/fit_model.R Outdated Show resolved Hide resolved
R/fit_model.R Outdated Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
R/fit_model.R Show resolved Hide resolved
Co-authored-by: Adam Howes <adamthowes@gmail.com>
Copy link
Collaborator

@natemcintosh natemcintosh left a comment

Choose a reason for hiding this comment

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

I think this is great. My only question was about what happens if a user forgets to specify all the necessary fields in one of the input lists to fit_model()

@zsusswein
Copy link
Collaborator Author

/document

Copy link
Collaborator

@athowes athowes left a comment

Choose a reason for hiding this comment

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

LGTM!

@zsusswein zsusswein merged commit 1574874 into main Sep 12, 2024
8 checks passed
@zsusswein zsusswein deleted the zs-fit-model branch September 12, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants