From 738d3229a641c5b9903c091466e8f63386a12093 Mon Sep 17 00:00:00 2001 From: Matthew Pitkin <matthew.pitkin@ligo.org> Date: Sun, 3 Mar 2019 21:45:00 +0000 Subject: [PATCH] Minor fix of sampling --- bilby/core/prior.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bilby/core/prior.py b/bilby/core/prior.py index c9749e944..1950e61a3 100644 --- a/bilby/core/prior.py +++ b/bilby/core/prior.py @@ -2120,16 +2120,15 @@ class MultivariateGaussian(object): """ # samples drawn from unit variance uncorrelated multivariate Gaussian - inbound = False - samps = np.zeros((size, len(self))) for i in range(size): + inbound = False while not inbound: # sample the multivariate Gaussian keys vals = np.random.uniform(0, 1, len(self)) samp = self.rescale(vals, mode=mode) - samps[:, j] = samp + samps[i, :] = samp # check sample is in bounds (otherwise perform another draw) outbound = False -- GitLab