Open maxbiostat opened 5 years ago
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.
We could do an experiment where we fix
beta
, andR0
(and thus we knowgamma
) andS0
and also the log-normal likelihood variancesigma_y^2
. We then simulate a SIR trajectory from this process and then fit the model using (i) Gamma priors onbeta
andgamma
and (ii) moment-matching log-normal priors onbeta
andgamma
. We then look at the recovery ofR0
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.