We starting to get into the computational part of my Bayesian class, so I thought it would be helpful to point out some of the ways to get help in the special R functions in LearnBayes.
Using R scripts from my website
In the folder http://bayes.bgsu.edu/bcwr/R%20scripts/ I show the R scripts for all of the examples in the 2nd edition of the book. You can copy and paste these scripts directly into the R console. Or you can use the source command to bring these examples into R. Here is an example where I illustrate the multinomial example from Chapter 4.
Using the R demo function:
Also, all of the R scripts in the examples are available as part of the LearnBayes package.
Once you have loaded in the LearnBayes package, you can see a listing of all of these examples by typing
If I want to run the multinomial demo from Chapter 4, section 3, type
You may get some error messages if you run these demos on a Macintosh. I use special R Windows functions so you get to pause the graphical output. I suspect there are better ways of writing these demos to adapt to the particular environment (Mac or Windows), but I haven’t figured it out yet.