Commit 92d57abd authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Add fixed-prior samples to the posterior data frame

Previously variables with a fixed (or delta function) prior where not
added to the posterior data frame; the documentation for
`samples_to_posterior` indicates that this is the case. This resolves that.
parent af1e374b
Pipeline #30296 passed with stage
in 5 minutes and 33 seconds
......@@ -236,7 +236,8 @@ class Result(dict):
return self.posterior_volume / self.prior_volume(priors)
def plot_corner(self, parameters=None, save=True, dpi=300, **kwargs):
def plot_corner(self, parameters=None, save=True, priors=None, dpi=300,
""" Plot a corner-plot using corner
See for a detailed API.
......@@ -423,6 +424,9 @@ class Result(dict):
self.samples, columns=self.search_parameter_keys)
data_frame['log_likelihood'] = getattr(
self, 'log_likelihood_evaluations', np.nan)
for key in priors:
if getattr(priors[key], 'is_fixed', False):
data_frame[key] = priors[key].peak
# We save the samples in the posterior and remove the array of samples
del self.samples
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