Bayesian Statistics: An Introduction: C++ programs
C++ programs can be run on Windows using http://www.cygwin.com/
Computer programs (in C++) relating to the book
(revised 27 October 2007 to present standards)
- baseball.cpp
Baseball example (Section 8.3 and Chapter 8, Exercise 4)
- chained.cpp
Example on chained data augmentation due to Casella and George
(Section 9.4)
- coalnr.cpp
Change point analysis of coal disaster data
(using gamma variates with integer parameters) (Section 9.4)
- dataaug.cpp
Genetic linkage example on data augmentation (Sections 9.2 and 9.3)
- dataaug2.cpp
Genetic linkage example (Chapter 9, Exercises 3 and 8)
- hiernorm.cpp
Hierachical normal model (Sections 9.2)
- hiernor2.cpp
Hierachical normal model (Chapter 9, Exercise 6)
- integral.cpp
Crude Monte Carlo integration (Chapter 9, Exercise 1)
- Rat data (Chapter 9, Exercise 11)
- rats.dat (data file)
- gelfand.pdf Extract
from Gelfand et. al. with a detailed description of the
hierarchical model for the rats data (LaTeX source at
gelfand.htm).
- wishart.h
Generates random matrices with a Wishart distribution
- rwishart.pdf
Extract (pp. 230-233) from W J Kennedy, Jr, and J E Gentle,
Statistical Computing, New York: Dekker 1980.
- rats.cpp Rat data (Chapter 9, Exercise 11)
- reject.cpp
Example of rejection sampling (Section 9.5)
- semiconj.cpp
Semi-conjugate prior with normal likelihood (Sections 9.2 and 9.4)
- semicon2.cpp
Semi-conjugate prior with normal likelihood (Chapter 9, Exercise 5)
Auxiliary routines and data
used by the above programs
- random.h (including nrerror from nrutil)
Random number generators
- jacobi.h
Jacobi transformations of a symmetric matrix
- nrutil.h (less nrerror now in random.h)
General utility routines for numerical recipes
- wishart.h
Generates random matrices with a Wishart distribution
- rats.dat
Data used by the program rats.dat
Peter M. Lee
Revised 3 November 2013