-
Notifications
You must be signed in to change notification settings - Fork 1
Home
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.
- 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). The best fit value is in the top left and the sigma is below that. If there is a second set of numbers, those are from the guess. The number at the end of the plot title is the sigma of that parameter (so you can compare your input sigma to the output sigma)
Important: your parinfo should contain fixed
, limited
, limits
, and fixed
tags. No more or fewer. See lines 15-17 in the test program.