Shiny Bayesian Updates

2015-07-24 R Bayesian Shiny Andrew B. Collier

Reading Bayesian Computation with R by Jim Albert (Springer, 2009) inspired a fit of enthusiasm. Admittedly, I was on a plane coming back from Amsterdam and looking for distractions. I decided to put together a Shiny app to illustrate successive Bayesian updates. I had not yet seen anything that did this to my satisfaction. I like to think that my results come pretty close.

Below is a screenshot.

Basically the idea is:

  1. start with a beta prior (you specify the α and β parameters);
  2. enter the results of an experiment (number of trials and the number of successes); then
  3. the associated likelihood and resulting posterior distribution are displayed;
  4. the prior is updated from the posterior distribution by pressing the “Update” button;
  5. repeat at your leisure.

I also wanted to mention a related article by my friend and colleague, Ryan Nel, which contains some very cool visuals.

Hope that somebody finds this useful and interesting. Feedback would be appreciated.

Next: IEEE Spectrum Puts R in 6th Place.
Previous: Lightning on your Twitter Feed.