-
Notifications
You must be signed in to change notification settings - Fork 2
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
Distributions in Rt estimation using {EpiNow2} #113
Comments
It's this way because EpiNow2 at the moment only accepts: gamma, lognormal, or non parametric distributions: https://epiforecasts.io/EpiNow2/reference/dist_spec.html Using non-parametric would work in all situations but I suspect it has its downsides if the distribution is actually known. |
Thanks Hugo, so regarding the code for this chunk, it is okay for me to remove the hard-coded gamma distribution and change it to a generic version to account for all distributions that are accounted for by EpiNow2? |
From a statistical point of view, the most robust approach would be to pass gamma and lognormal as is and pass other distributions as non-parametric. cc @sbfnk for confirmation. |
I'm not sure there is such a downside if the parameters have no uncertainty and the distribution id discrete (or discretised) and truncated - in this case even if passing a probability distribution with parameters it would be converted to a pmf by EpiNow2 before passing to the stan model. |
To be sure we're on the same page:
Agreed on this. But there are still benefits to passing gamma and lognormal as is, without discretizing them, aren't they? |
Something like the following pseudo-code:
In English: if we use a distribution supported out of the box by EpiNow2, we pass it as is. If we are using a distribution not supported by EpiNow2, we pass it as an empirical pmf. |
There's not actually a particular benefit to passing the distributional parameters to EpiNow2 except that you might get a more appropriate discretisation (taking into account that it's a delay censored at both ends). Apart from that, if there is no uncertainty in the distributional parameters it's fine to just pass the pmf. |
Thanks! This simplifies our problem a lot then. Let's always pass the pmf directly so we don't have to special case lognormal and gamma distributions. |
Thank you both, this is now resolved so I'm closing the issue |
Currently the .rmd chunk that uses EpiNow2 for the estimation of Rt of the transmissibility report is fixed for a gamma distribution:
# Approximate serial interval with gamma distribution since this is what EpiNow2 will use for generation_time
si_gamma <- epiparameter::extract_param( type = "range", values = c(median(si$r(1e3)), min(si$r(1e3)), max(si$r(1e3))), distribution = "gamma", samples = 1e3 ) si_gamma <- epiparameter::gamma_shapescale2meansd(si_gamma[[1]], si_gamma[[2]])
I imagine this is because the previous version of the template was assuming a gamma distribution, but since we agreed that this was hard coded when it shouldn't be to allow for flexibility, the rmd chunk should also be changed to take the distribution from the params list.
This change would be included on PR #100 to update epiparameter usage
The text was updated successfully, but these errors were encountered: