Skip to content
Snippets Groups Projects

Add reflective boundary conditions

Merged Colm Talbot requested to merge reflecting-boundaries into master
Files
3
@@ -438,14 +438,8 @@ class Dynesty(NestedSampler):
The logic ensures that when theta < 0 you shift to |theta| and when
theta > 1 you return 2 - theta
"""
theta_init = theta.copy()
theta[self._periodic] = np.mod(theta[self._periodic], 1)
theta_ref = theta[self._reflective]
theta[self._reflective] = np.minimum(
np.maximum(theta_ref, abs(theta_ref)), 2 - theta_ref)
# theta_ref[theta_ref < 0] = abs(theta_ref[theta_ref < 0])
# theta_ref[theta_ref > 1] = 2 - theta_ref[theta_ref > 1]
# theta[self._reflective] = theta_ref
if min(theta) < 0 or max(theta) > 1:
import IPython; IPython.embed()
return self.priors.rescale(self._search_parameter_keys, theta)
Loading