B - Computer Programs for MCMC Calculations
Published online by Cambridge University Press: 05 June 2012
Summary
THE MODELS DISCUSSED in this book are rather easy to program, and students are encouraged to do some or all of the exercises by writing their own programs.
The Gauss and Matlab programs are good choices.
If you program in Matlab, you should be aware of a few differences between the program and our presentation.
B.1 The inverted gamma function is not available. Instead, sample for 1/σ2, which has a gamma distribution with the same parameters.
B.2 The Matlab version of the gamma function defines the second parameter as the inverse of our version; that is, in our notation, G(α, δ1), is interpreted by Matlab as G(α, δ2) where δ2 = 1/δ1.
B.3 In the univariate normal distribution, Matlab expects N(µ, σ); that is, it expects the standard deviation as the second argument rather than the variance. (In Matlab's multivariate normal function, the second argument is the covariance matrix.)
A number of free programs are available through the Internet that implement the Gibbs sampler for some of the models studied in this book. We mention three:
BACC is supported by the National Science Foundation. Its authors request that the following acknowledgments and reference be included.
[…]
- Type
- Chapter
- Information
- Introduction to Bayesian Econometrics , pp. 192 - 193Publisher: Cambridge University PressPrint publication year: 2007