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

Write and test a forecast function which projects inference forwards in time #239

Conversation

SamuelBrand1
Copy link
Collaborator

This PR implements a forecasting function for the pipeline. The idea behind this function is to use Turing.predict to sample from a model defined on a longer time interval conditional on an MCMCChains.Chain object that was generated by Bayesian inference.

There was a problem with this approach combined to vectorised random variables, but I've used "fix 1" from the issue I submitted to Turing TuringLang/Turing.jl#2239 .

NB: This PR should be strengthened with direct distribution tests on underlying forecast variables using HypothesisTests.jl. The reason this is not yet implemented is due to wanting to insert a test environment into the pipeline (this will be an issue).

Closes #231 .

@seabbs
Copy link
Collaborator

seabbs commented May 29, 2024

NB: This PR should be strengthened with direct distribution tests on underlying forecast variables using HypothesisTests.jl. The reason this is not yet implemented is due to wanting to insert a test environment into the pipeline (this will be an issue)

I suggest we make this a new issue/PR vs being blocked

@SamuelBrand1
Copy link
Collaborator Author

NB: This PR should be strengthened with direct distribution tests on underlying forecast variables using HypothesisTests.jl. The reason this is not yet implemented is due to wanting to insert a test environment into the pipeline (this will be an issue)

I suggest we make this a new issue/PR vs being blocked

Added an issue. Agree this is not a blocker.

Copy link
Collaborator

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

LGTM.

I think we should merge and open new issues to:

  1. Add unit tests based on the new example/toy/test pipeline
  2. Work to do to port core functionality into EpiAware (i.e. the method to extend epiproblems and a helper wrapper like generate_forecasts but with less dependence on configs).

I see some seemingly unrelated changes in define_epiprob. I don't love the hard coding of the generation time as Gamma but as this will shortly need a refactor when we merge in the changes to the infection module in EpiAware I think this approach is fine for now.

@seabbs seabbs enabled auto-merge (squash) May 29, 2024 10:53
@seabbs
Copy link
Collaborator

seabbs commented May 29, 2024

I forgot to add but f2f @SamuelBrand1 and I have spoken about how great this functionality is in Turing - very exciting stuff.

@SamuelBrand1
Copy link
Collaborator Author

I forgot to add but f2f @SamuelBrand1 and I have spoken about how great this functionality is in Turing - very exciting stuff.

The Turing.predict functionality is really interesting.

@SamuelBrand1
Copy link
Collaborator Author

LGTM.

I think we should merge and open new issues to:

  1. Add unit tests based on the new example/toy/test pipeline
  2. Work to do to port core functionality into EpiAware (i.e. the method to extend epiproblems and a helper wrapper like generate_forecasts but with less dependence on configs).

I see some seemingly unrelated changes in define_epiprob. I don't love the hard coding of the generation time as Gamma but as this will shortly need a refactor when we merge in the changes to the infection module in EpiAware I think this approach is fine for now.

Agreed. The hard coded preference of the analysis we are doing is what is keeping this out of EpiAware atm.

@seabbs seabbs merged commit 496c6e9 into main May 29, 2024
10 checks passed
@seabbs seabbs deleted the 231-write-and-test-a-forecast-function-which-projects-inference-forwards-in-time branch May 29, 2024 11: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.

Write and test a forecast function which projects inference forwards in time.
2 participants