maxbiostat / R0_uncertainty

Some remarks on prior modelling for the basic reproductive number in the Susceptible-Infected-Recovered (SIR) epidemic model
6 stars 2 forks source link

Evaluate the performance of Gamma and log-normal priors on simulated data #27

Open maxbiostat opened 5 years ago

maxbiostat commented 5 years ago

We could do an experiment where we fix beta, and R0 (and thus we know gamma) and S0 and also the log-normal likelihood variance sigma_y^2. We then simulate a SIR trajectory from this process and then fit the model using (i) Gamma priors on beta and gamma and (ii) moment-matching log-normal priors on beta and gamma. We then look at the recovery of R0both in the squared error of the posterior mean and coverage of the Bayesian credibility intervals (BCI).

Check the functions generate_trajectory_* I used to generate the prior predictives in the notebooks. They can be easily modified to generate data from fixed parameters.

fccoelho commented 3 years ago

Which notebook has these codes?

maxbiostat commented 3 years ago

https://github.com/maxbiostat/R0_uncertainty/blob/master/code/old_notebooks/boardingSchool(gamma)_11_06_20.ipynb is a good place to start

fccoelho commented 3 years ago

What about Inference.ipynb? But I think neither of these use cmdstan, do they? I need an example of cmdstan I can adapt.

maxbiostat commented 3 years ago

I'm gonna have to write one then. @marciomacielbastos used PyStan ages ago.

fccoelho commented 3 years ago

Documentation for cmdstanpy is next to useless.

maxbiostat commented 3 years ago

What about Inference.ipynb? But I think neither of these use cmdstan, do they? I need an example of cmdstan I can adapt.

This notebook could be well-adapted, but my advice is to save the Stan programs in a separate file to facilitate sharing and reproducibility. One could then have a Stan program with Gamma priors, another with log-normal priors, another with half-normal priors and then compare the inferences drawn for the same data in a single notebook.