Evaluate the performance of Gamma and log-normal priors on simulated data
maxbiostat opened this issue · 6 comments
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 R0
both 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.
Which notebook has these codes?
What about Inference.ipynb?
But I think neither of these use cmdstan, do they? I need an example of cmdstan I can adapt.
I'm gonna have to write one then. @marciomacielbastos used PyStan ages ago.
Documentation for cmdstanpy is next to useless.
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.