java-timeseries icon indicating copy to clipboard operation
java-timeseries copied to clipboard

Loop in BFGS.java#127 can fall into infinite loop.

Open Ajk4 opened this issue 8 years ago • 1 comments

See discussion in PR https://github.com/signaflo/java-timeseries/pull/3

Code

while (!(Double.isFinite(functionValue) &&
                           functionValue < priorFunctionValue + C1 * stepSize * slopeAt0) && !stop) {

can fall into infinite loop.

Ajk4 avatar Oct 25 '17 08:10 Ajk4

Release 0.4 includes the simplest solution of using a counter to keep track of the number of iterations and exiting the loop when the maximum is reached. It is far preferable to understand why the algorithm is falling into this state and taking steps to prevent that.

signaflo avatar Nov 01 '17 06:11 signaflo