Skip to content
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

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

Open
maxbiostat opened this issue Sep 21, 2019 · 6 comments
Assignees

Comments

@maxbiostat
Copy link
Owner

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
Copy link
Collaborator

Which notebook has these codes?

@maxbiostat
Copy link
Owner Author

@fccoelho
Copy link
Collaborator

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

@maxbiostat
Copy link
Owner Author

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

@fccoelho fccoelho self-assigned this Mar 17, 2021
@fccoelho
Copy link
Collaborator

Documentation for cmdstanpy is next to useless.

@maxbiostat
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants