The middle point is identical to lower, so the model never converges below the threshold.
Solutions:
I see two ways of solving the problem:
Compute the right eps for the current value range: 2 * np.finfo(float).eps * lower, or more accurately, np.finfo(float).eps * 2 ** math.floor(1 + math.log2(lower)),
Allow the user to specify their own threshold.
The first case is better suited to the current code, but getting alpha to within machine precision may not always be necessary.
Description
optimizealpha fails when the optimal alpha is a bit big. In my particular case, upper and lower values are:
The middle point is identical to
lower
, so the model never converges below the threshold.Solutions:
I see two ways of solving the problem:
eps
for the current value range:2 * np.finfo(float).eps * lower
, or more accurately,np.finfo(float).eps * 2 ** math.floor(1 + math.log2(lower))
,The first case is better suited to the current code, but getting alpha to within machine precision may not always be necessary.