-
Notifications
You must be signed in to change notification settings - Fork 1
Home
billfreeman44 edited this page Dec 17, 2014
·
15 revisions
Welcome to the mpmcmcfun wiki!
- IDL not run on a virtual machine (execute command doesn't work, which is critical)
- Astronomy library
- Coyote library (needed for plots)
- Astronomy library (needed for the example)
- the ability to write a file somewhere on your own machine.
METROPOLIS-HASTINGS algorithm
- calculate initial likelihood
- perturb one parameter
- recalculate likelihood (NOTE: if one of the parameters exceeds one of the limits in parinfo, the likelihood is set to 0)
- if better likelihood, add this set of parameters to the chain
- if worse likelihood, add parameters to chain if random number between 0 and 1 is greater than the ratio of the two likelihoods.
- go back to step 2 until you run out of iterations.
- calculate histogram w/ 50 elements
- fit gaussian to histogram to estimate best value and error.
If you don't set the keyword temp_filename
then a file is created "mcmc_test.txt" in your home folder. If you set the keyword, it will be created there (you must name it as well, like temp_filename='bill/dir1/dir2/tempfile.txt')
Every single parameter and calculated parameter are output with the format F13.5
. You can input your own format string with the format_str
keyword, but it must contain the format for each variable.
The output plots show the histogram and the guess for the gaussian (dashed line) and the actual gaussian fit (solid line).