-
Notifications
You must be signed in to change notification settings - Fork 4
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
Issue 465: Add an infection generating model for ODE problems #510
Conversation
Try this Pull Request!Open Julia and type: import Pkg
Pkg.activate(temp=true)
Pkg.add(url="https://github.com/CDCgov/Rt-without-renewal", rev="sciml-infection-model", subdir="EpiAware")
using EpiAware |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #510 +/- ##
==========================================
+ Coverage 89.64% 90.51% +0.86%
==========================================
Files 53 56 +3
Lines 753 822 +69
==========================================
+ Hits 675 744 +69
Misses 78 78 ☔ View full report in Codecov by Sentry. |
Updating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really nice. Mostly renaming along with some questions where I think the SciML approach is clashing with our current approach elsewhere.
My particular concern is the pattern you envisage for integrating this with a current (or future generate_epiaware call).
Good idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Close. One more round of tightening and some push back about the use of the latent model.
- `p`: A vector containing the parameters `[β, α, γ]` where `β` is the infectiousness rate, | ||
`α` is the incubation rate, and `γ` is the recovery rate. | ||
""" | ||
@model function EpiAwareBase.generate_latent(params::SEIRParams, Z_t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implicit promise of this being a latent model is that it will work with the library of latent model functionality. Does this implementation do so? If no do we need to rethink the idea of making this a latent model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure off the top of my head... I think this an example of something we should think about generally #525
Benchmark resultJudge resultBenchmark Report for /home/runner/work/Rt-without-renewal/Rt-without-renewalJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/Rt-without-renewal/Rt-without-renewalJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/Rt-without-renewal/Rt-without-renewalJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good for now but I find the use of latent model here a bit jarring and indicative of a wider design flaw. I see the issue to discuss so let's do that there.
Less fussily though this is great functionality to have
* Patch: Switch to fork of benchmarkCI (#520) * patch to fork of benchmarkCI * put fork version of BenchmarkCI in [sources] * swap order * add EpiAware [source] * fix path * rm benchmarkCI from project * Patch fix: add `Manifest.toml` to benchmarking (#524) * trigger * Update benchmark.yaml * Update benchmark.yaml * commit benchmark Manifest * try alternate approach * Update benchmark.yaml * Update EpiMethod.jl * Update benchmark.yaml * change baseline to origin/main * remove trigger * rm other trigger * Issue 465: Add an infection generating model for ODE problems (#510) * CompatHelper: bump compat for Turing to 0.35 for package EpiAware, (drop existing compat) (#516) * CompatHelper: bump compat for Turing to 0.35 for package EpiAware, (drop existing compat) * Update Project.toml * fix Project.toml --------- Co-authored-by: CompatHelper Julia <[email protected]> Co-authored-by: Sam Abbott <[email protected]> Co-authored-by: Samuel Brand <[email protected]> Co-authored-by: Samuel Brand <[email protected]> * CompatHelper: bump compat for DynamicPPL to 0.30 for package EpiAware, (drop existing compat) (#528) Co-authored-by: CompatHelper Julia <[email protected]> * rename IDD -> IID * rename test file * Issue 529: Create null Latent model (#530) * Null Latent model * Null Latent model * fix doctest * fix generate_epiaware unit tests New usage of RW * fix turing method test underlying std of step size changed name * fix broadcast test Underlying std param changed name * fix HN unit test Default std prior had changed * fix AR unit tests --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: CompatHelper Julia <[email protected]> Co-authored-by: Sam Abbott <[email protected]>
* draft MA method * draft MA methd * use IDD for epsilon in all models * add MA benchmark * Add docs and tests for IDD * make episilon_t a arg of the latent model constructors * improve MA correctness * fully import EpiAwareUtils * add a test for IDD * add tests for MA.jl * add doc tests and unit tests + start on helper fn * more updatres to AR appraoc * chase down partial arg changes * clean up AR * clean up and add arma and arima helpers * Contributions towards Arma/Arima models (#531) * Patch: Switch to fork of benchmarkCI (#520) * patch to fork of benchmarkCI * put fork version of BenchmarkCI in [sources] * swap order * add EpiAware [source] * fix path * rm benchmarkCI from project * Patch fix: add `Manifest.toml` to benchmarking (#524) * trigger * Update benchmark.yaml * Update benchmark.yaml * commit benchmark Manifest * try alternate approach * Update benchmark.yaml * Update EpiMethod.jl * Update benchmark.yaml * change baseline to origin/main * remove trigger * rm other trigger * Issue 465: Add an infection generating model for ODE problems (#510) * CompatHelper: bump compat for Turing to 0.35 for package EpiAware, (drop existing compat) (#516) * CompatHelper: bump compat for Turing to 0.35 for package EpiAware, (drop existing compat) * Update Project.toml * fix Project.toml --------- Co-authored-by: CompatHelper Julia <[email protected]> Co-authored-by: Sam Abbott <[email protected]> Co-authored-by: Samuel Brand <[email protected]> Co-authored-by: Samuel Brand <[email protected]> * CompatHelper: bump compat for DynamicPPL to 0.30 for package EpiAware, (drop existing compat) (#528) Co-authored-by: CompatHelper Julia <[email protected]> * rename IDD -> IID * rename test file * Issue 529: Create null Latent model (#530) * Null Latent model * Null Latent model * fix doctest * fix generate_epiaware unit tests New usage of RW * fix turing method test underlying std of step size changed name * fix broadcast test Underlying std param changed name * fix HN unit test Default std prior had changed * fix AR unit tests --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: CompatHelper Julia <[email protected]> Co-authored-by: Sam Abbott <[email protected]> * revert define_ namming * clean out repeated utils from merge * fix MA tests * fix RW tests - feel made about RandomWalk vs AR naming * fix remaining unit tests that aren't doctests * update latent recovery test * try and fix doctests automatically * update all doctests to output nothing - this is awful * add doctests for arima and arma * fix doctest * clean up deps * update replication studies * add interface tests for combination functions and add benchmarks * add some basic theoretical properties tests * name change IDD -> IID benchmarks * moving all the constructors because this PR is too contained * catch missing using * update iid benchmark: * update extraction * remove old param namme from case study * get the dot * get the dot * fix initial guess point for MAP opt * Update index.jl * add a compile time branch for HN * add a compile time branch for HN * update test * add a new constructor to get old default behaviour * update docs * update docs - using the structs for priors is very brittle * reorder prior plots --------- Co-authored-by: Samuel Brand <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: CompatHelper Julia <[email protected]> Co-authored-by: Samuel Brand <[email protected]>
This PR closes #465 .
Contributions
This PR contributes the following:
InfectionODEProcess
subtype ofAbstractTuringEpiModel
which defines the behaviour of a class of ODE based epi model.ODEParams
type for passing to the method ofgenerate_latent_infs
that dispatches the ODE solver.generate_latent_infs
method.ODE problem details
The ODE problem specialises to
u0
must be a vector or matrix.sol
object that is returned from an ODEsolve
call.Minor contributions and things to note
InfectionODEProcess
based generation.sciml
style might have changed becauseJuliaFormatter
made a large number of small whitespace changes to files outside the scope.