Skip to content

Commit

Permalink
Fix bug in slice sampler: sample the prior
Browse files Browse the repository at this point in the history
  • Loading branch information
johnveitch committed Jan 26, 2021
1 parent 22345ce commit 8a45bb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpnest/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def yield_sample(self, logLmin):
parameter_left = direction_vector * self.L + oldparam

if self.model.in_bounds(parameter_left):
if Y > self.model.log_likelihood(parameter_left):
if Yp > self.model.log_prior(parameter_left):
break
else:
self.increase_left_boundary()
Expand All @@ -510,7 +510,7 @@ def yield_sample(self, logLmin):

if self.model.in_bounds(parameter_right):

if Y > self.model.log_likelihood(parameter_right):
if Yp > self.model.log_prior(parameter_right):
break
else:
self.increase_right_boundary()
Expand Down

0 comments on commit 8a45bb0

Please sign in to comment.