-
Notifications
You must be signed in to change notification settings - Fork 7
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
Full package review for v0.2.0 release #161
Conversation
I've just added branch protection rules for the |
zeros.fill(0); | ||
|
||
Eigen::ArrayXd epi_final_size(nDim); // prev in settings struct | ||
epi_final_size.fill(0.5); |
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.
Can we get a better initial guess thanks to the theory in this domain?
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 don't think so. For example, the simple case of finding the final size is included as a function in the tests here as
finalsize/tests/testthat/test-statistical_correctness.R
Lines 5 to 15 in 2d7c681
upper_limit <- function(r0) { | |
f <- function(par) { | |
abs(1 - exp(-r0 * par[1]) - par[1]) | |
} | |
opt <- optim( | |
par = 0.5, fn = f, | |
lower = 0.0, upper = 1.0, | |
method = "Brent" | |
) | |
opt | |
} |
The method here also starts with a guess of 0.5 if I've understood correctly, so this might be a standard starting point. Happy for @BlackEdder or @adamkucharski to weigh in.
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.
Yes we can get a better starting point based on pre-filled estimates from a non-age structured final size equation. If you solve for R0s in 1:20 (for example) that will give you a place to start for all age groups.
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.
Thanks - I haven't really understood that. We are already passing
I could add an 'initial guess' parameter to the solvers, so that it's 0.5 by default, but could also be a vector coming from an earlier solver run on non-age structured populations? This might get a little recursive.
Thanks for taking a look @Bisaloo. I've done a little bit of reorganisation to the solver files to move the contact matrix scaling to the main function using a |
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.
Are profiling and/or benchamarking tools used to determine when code needs to be written in C. If so are there any guidelines on when it would be a good idea to use C instead of R.
This issue has been raised more broadly in epiverse-trace/blueprints#11, and I think the consensus reached in the Slack discussions at least is to use R unless:
Re: 1, the current solver algorithms and overall methods were taken from C++ code written by @BlackEdder; and the R code was my translation of those methods; see PRs #4, #12 etc. The considerations around {epidemics} were similar, with the expectation being that models that could be included in the library would have been written in C++ already (see e.g. https://github.com/dchodge/rsv_trans_model or {fluEvidenceSynthesis}; but see {vacamole} as a counterpoint). We have not yet incorporated any external models into {epidemics} so it might be too early to say how this calculation will work out. Some benchmarks for {finalsize} from the Slack channel here run by @TimTaylor.
|
This PR is now moving to tackling issues in #163 - further comments will relate to items in the release checklist. |
Progress on task items in the release checklist in issue #163 was being tracked in a comment here, and has now been moved to the comments of #163 - see #163 (comment). |
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
Co-authored-by: Hugo Gruson <[email protected]>
This PR trials a full repository review for the package, and is also working towards items listed in #163.