Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-fbnjt Total loading time: 0 Render date: 2024-11-19T13:18:10.488Z Has data issue: false hasContentIssue false

B - Computer Programs for MCMC Calculations

Published online by Cambridge University Press:  05 June 2012

Edward Greenberg
Affiliation:
Washington University, St Louis
Get access

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.

  1. B.1 The inverted gamma function is not available. Instead, sample for 1/σ2, which has a gamma distribution with the same parameters.

  2. 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.

  3. 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
Publisher: Cambridge University Press
Print publication year: 2007

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×