Bayesian analysis of Santa Clara study: Run it yourself in Google Collab, play around with the model, etc!

The other day we posted some Stan models of coronavirus infection rate from the Stanford study in Santa Clara county.

The Bayesian setup worked well because it allowed us to directly incorporate uncertainty in the specificity, sensitivity, and underlying infection rate.

Mitzi Morris put all this in a Google Collab notebook so you can run it online. here.


To run it in Python, go here:

Click on Open in Collab and log in using your gmail, and you’ll see this:

Then just run the code online, one paragraph at a time, by clicking in the open brackets [ ] at the top left of each paragraph, going down the page.

The first time you click, you’ll get this annoying warning message:

Just click on Run Anyway and it will work.

The first few paragraphs load in CmdStan and upload the model and data. After that the fun begins and you can run the models.


Same thing, just start here.

Altering the Stan programs online

There was a way on these Collab pages to go in and alter the code and then re-run the model, which was really helpful in understanding what was going on, as it allowed you to play around with the Stan code. I can’t figure out how to do this with the above pages, but for now you can find everything in Github.

P.S. Loki (pictured above) wants to push this commit, but first he wants you to do some unit tests and clean his litter box.