Skip to content
Snippets Groups Projects
Commit c47ba9d2 authored by Kipp Cannon's avatar Kipp Cannon
Browse files

tweak root finding in cdf_weighted_chisq_Pinv()

parent 85b3549f
No related branches found
No related tags found
No related merge requests found
......@@ -51,11 +51,13 @@ from _misc import *
#
import sys
def cdf_weighted_chisq_Pinv(A, noncent, dof, var, P, lim, accuracy):
func = lambda x: cdf_weighted_chisq_P(A, noncent, dof, var, x, lim, accuracy) - P
lo = 0.0
hi = 1.0
while func(hi) < 0:
lo = hi
hi *= 8
hi *= 2
print >>sys.stderr, lo, hi
return optimize.brentq(func, lo, hi, xtol = accuracy * 4)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment