dfm/emcee — pull request #99 by mrgeorge (2014-02-09 04:15:38+00:00)
Title: Avoid RuntimeWarning when subtracting infs

In the _propose_stretch method of EnsembleSampler, occasionally both the new and proposed lnprob values are out of bounds of some prior and set to -np.inf. In cases where newlnprob and lnprob0 are both -np.inf (and type float64),

accept = A + newlnprob - lnprob0 > B

raises a warning for invalid value in subtract. The subtraction evaluates to nan, and accept is set to False.
On the other hand,

accept = A + newlnprob > lnprob0 + B

correctly evaluates to False with no warning. This commit makes that minor manipulation to avoid that warning message.