From 7777c1363946220d6dfb8d15e88b0064ab54fa2f Mon Sep 17 00:00:00 2001 From: joezuntz Date: Thu, 20 Jun 2024 14:39:56 +0100 Subject: [PATCH] Trim blobs in Sampler.posterior If trim_importance weights is set in Sampler.posterior then the blobs are not currently trimmed, leading to them being a different size and misaligned with the samples. --- pocomc/sampler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pocomc/sampler.py b/pocomc/sampler.py index 0190af3..1611bde 100644 --- a/pocomc/sampler.py +++ b/pocomc/sampler.py @@ -947,6 +947,8 @@ def posterior(self, resample=False, return_blobs=False, trim_importance_weights= logl = logl[idx] logp = logp[idx] logw = logw[idx] + if return_blobs: + blobs = blobs[idx] if resample: if self.resample == 'mult':