From 82008a52fbc6a99e9362d0c615a2d755dccc248b Mon Sep 17 00:00:00 2001 From: "Per.Andreas.Brodtkorb" Date: Thu, 11 Jul 2013 12:59:53 +0000 Subject: [PATCH] Fixed a bug in dispersion_idx --- pywafo/src/wafo/stats/core.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pywafo/src/wafo/stats/core.py b/pywafo/src/wafo/stats/core.py index 1a0fedc..2818695 100644 --- a/pywafo/src/wafo/stats/core.py +++ b/pywafo/src/wafo/stats/core.py @@ -281,6 +281,8 @@ def dispersion_idx(data, t=None, u=None, umin=None, umax=None, nu=None, nmin=10, >>> Ie = findpot(data,t,0,5); >>> di, u, ok_u = dispersion_idx(data[Ie],t[Ie],tb=100) >>> h = di.plot() # a threshold around 1 seems appropriate. + >>> round(u*100)/100 + 1.03 vline(u) @@ -365,8 +367,8 @@ def dispersion_idx(data, t=None, u=None, umin=None, umax=None, nu=None, nmin=10, p = 1 - alpha - diUp = _invchi2(1 - alpha / 2, M - 1) / (M - 1) - diLo = _invchi2(alpha / 2, M - 1) / (M - 1) + diLo = _invchi2(1 - alpha / 2, M - 1) / (M - 1) + diUp = _invchi2(alpha / 2, M - 1) / (M - 1) # Find appropriate threshold k1, = np.where((diLo < di) & (di < diUp)) @@ -1364,6 +1366,6 @@ def test_doctstrings(): if __name__ == '__main__': - test_reglogit2() - #test_doctstrings()( + #test_reglogit2() + test_doctstrings()