Fixed a bug in dispersion_idx

master
Per.Andreas.Brodtkorb 12 years ago
parent a40fc7b7aa
commit 82008a52fb

@ -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); >>> Ie = findpot(data,t,0,5);
>>> di, u, ok_u = dispersion_idx(data[Ie],t[Ie],tb=100) >>> di, u, ok_u = dispersion_idx(data[Ie],t[Ie],tb=100)
>>> h = di.plot() # a threshold around 1 seems appropriate. >>> h = di.plot() # a threshold around 1 seems appropriate.
>>> round(u*100)/100
1.03
vline(u) 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 p = 1 - alpha
diUp = _invchi2(1 - alpha / 2, M - 1) / (M - 1) diLo = _invchi2(1 - alpha / 2, M - 1) / (M - 1)
diLo = _invchi2(alpha / 2, M - 1) / (M - 1) diUp = _invchi2(alpha / 2, M - 1) / (M - 1)
# Find appropriate threshold # Find appropriate threshold
k1, = np.where((diLo < di) & (di < diUp)) k1, = np.where((diLo < di) & (di < diUp))
@ -1364,6 +1366,6 @@ def test_doctstrings():
if __name__ == '__main__': if __name__ == '__main__':
test_reglogit2() #test_reglogit2()
#test_doctstrings()( test_doctstrings()

Loading…
Cancel
Save