1. You've fitted a Bayesian Normal model!
Great! You’ve now fitted a Bayesian normal model and used it to do both statistical inference regarding the underlying mean, and predictive analysis of what future data might be. But it sure took a lot of effort. As this course has focused on fundamentals, we’ve been building things up from scratch. Which is good for learning how things work, but once you know how things work you want to be efficient. When doing Bayesian data analysis for real you sometimes have to build models from scratch, but most often you can use an off-the-shelf, pre-packaged model and save yourself the effort. As a last thing in this course, we’ll take a look at a pre-packaged model called BEST
2. BEST
developed by John Kruschke. It is is a souped-up version of the model we used to analyze the temperature and the zombie IQ data. The main difference is that BEST assumes that the data comes from a t-distribution instead of a normal distribution. The t-distribution is just like the normal distribution, a generative model with a mean and a standard deviation that generates heap shaped data. The difference is that the t-distribution has an extra parameter, sometimes called the degrees-of-freedom parameter, that governs how likely the t-distribution is to generate outliers far from its center.
3. Dotplot Normal
When the degrees-of-freedom parameter is high, say, 30 or more, the t-distribution takes the same shape as the normal distribution. But when the degrees-of-freedom
4. Dotplot t
is low, the t-distribution generates more and more outliers. A generative model that assumes that there might be outliers is also robust against outliers when used in a Bayesian model.
5. BEST
The BEST model will simultaneously estimate the mean, standard deviation, and degrees-of-freedom parameter, and all of this is nicely wrapped up in the BEST package which you can install in R. Another way in which BEST is different is that BEST uses a so-called Markov chain Monte Carlo method to fit the model. This is something we haven’t covered, but as Markov chain Monte Carlo, or MCMC for short, returns a table of samples from the posterior, we can work with the output just like before. So,
6. Let's use BEST!
let’s use BEST on the zombie IQ data. After loading in BEST, we only call
7. Let's use BEST!
the BESTmcmc function, which will fit the model using a Markov chain Monte Carlo method. We can then take a look at
8. Let's use BEST!
a summary of the model result. We see that the estimated mean IQ is around 43 with a credible interval between 35 and 50, just as in your earlier analysis. What’s here called nu, is the degrees-of-freedom parameter. As it’s pretty large, it means that there weren’t many outliers in the data. Numbers are good, but the plots produced by BEST are also pretty nice
9. Let's use BEST!
Here we see the posterior distribution for the mean mu together with the credible interval and the mean of the posterior. Except for estimating the mean of one data set, BEST can also be used to compare two data sets,
10. Try out BEST yourself!
which you will get to try out yourself in the upcoming exercises.