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