changeset 22:f5b4a2ab6204

medcouple_1d: modify the definition of medc_idx to match R's definition This uses the right (not left) middle in case of an even number of things and the middle one in case of an odd number.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Sat, 17 Jan 2015 19:56:07 -0500
parents d63e763f8ac1
children 29a178b23219
files pymedcouple
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pymedcouple
+++ b/pymedcouple
@@ -153,7 +153,7 @@
 
     Ltot = 0
     Rtot = n_minus*n_plus
-    medc_idx = (Rtot - 1)//2
+    medc_idx = Rtot//2
 
     # kth pair algorithm (Johnson & Mizoguchi)
     while Rtot - Ltot > n_plus: