Commit e1df746c authored by Gregory Ashton's avatar Gregory Ashton

Ensure lnpostfn doesn't error when the sampler steps outside the prior

parent f709f23a
Pipeline #22977 passed with stages
in 11 minutes and 19 seconds
......@@ -786,7 +786,11 @@ class Emcee(Sampler):
return self.result
def lnpostfn(self, theta):
return self.log_likelihood(theta) + self.log_prior(theta)
p = self.log_prior(theta)
if np.isinf(p):
return -np.inf
else:
return self.log_likelihood(theta) + p
class Ptemcee(Emcee):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment