[AstroPy] Questions re: Markov Chain Monte Carlo
Peter Erwin
erwin at mpe.mpg.de
Tue Jun 4 05:54:56 EDT 2013
Hi Eric,
Whoops -- just realized that my proposed algorithm will occasionally return dummy chi^2 values rather than waiting until another subprocess has finished, which isn't what you want, so replace my "step 2" with:
2. If it's already there, just take the corresponding chi^2 value from the dictionary, or else wait for the other subprocess to finish calculations if it's working on these parameter values
currentChi2 = chi2ValuesDict[(Mdisk, Rdisk, T, ...)]
if chi2ValuesDict[(Mdisk, Rdisk, T, ...)] == 0:
# another subprocess is working on this set of parameter values, so wait until it's done -- e.g., sleep for 1s and then re-check to see if the stored value is no longer 0...
else:
return currentChi2
cheers,
Peter
=============================================================
Peter Erwin Max-Planck-Insitute for Extraterrestrial
erwin at mpe.mpg.de Physics, Giessenbachstrasse
tel. +49 (0)176 2481 7713 85748 Garching, Germany
fax +49 (0)89 30000 3495 http://www.mpe.mpg.de/~erwin
More information about the AstroPy
mailing list