We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3526b62 commit d33db68Copy full SHA for d33db68
tsdate/approx.py
@@ -75,7 +75,9 @@ def approximate_gamma_kl(x, logx):
75
assert alpha > 0, "kl-min: bad initial condition"
76
last = np.inf
77
itt = 0
78
- while np.abs(alpha - last) > alpha * 1e-8:
+ # determine convergence when the change in alpha falls below
79
+ # some small value (e.g. square root of machine precision)
80
+ while np.abs(alpha - last) > alpha * np.sqrt(np.finfo(np.float64).eps):
81
last = alpha
82
numer = hypergeo._digamma(alpha) - np.log(alpha) - logx + np.log(x)
83
denom = hypergeo._trigamma(alpha) - 1 / alpha
0 commit comments