From b6efc02a8a5499f4b7efed001b5545b9cfcb142a Mon Sep 17 00:00:00 2001 From: Lindley Graham Date: Mon, 9 May 2016 17:52:36 -0400 Subject: [PATCH] fixed sorting error in exact vol 1D --- bet/calculateP/calculateP.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bet/calculateP/calculateP.py b/bet/calculateP/calculateP.py index 9aee3a02..579c0483 100644 --- a/bet/calculateP/calculateP.py +++ b/bet/calculateP/calculateP.py @@ -424,7 +424,9 @@ def exact_volume_1D(samples, input_domain, distribution='uniform', a=None, edges = scipy.stats.beta.cdf(edges, a=a, b=b, loc=input_domain[:, 0], scale=domain_width) # calculate difference between right and left of each cell and renormalize - lam_vol = np.squeeze(edges[1:, :] - edges[:-1, :]) + sorted_lam_vol = np.squeeze(edges[1:, :] - edges[:-1, :]) + lam_vol = np.zeros(sorted_lam_vol.shape) + lam_vol[sort_ind] = sorted_lam_vol if distribution == 'uniform': lam_vol = lam_vol/domain_width # Set up local arrays for parallelism