Open
Description
I ran into a problem and had to make a source modification for the convergence criteria. The currently-implemented convergence criterion operates in absolute terms of the squared residuals. Real data sets with noise may have a minimal curve with an arbitrarily-large error, and convergence in those cases will not be recognized.
https://github.com/mljs/levenberg-marquardt/blob/master/src/index.js#L106
I modified the convergence criteria to be the relative change based on the previous error, as described here: https://en.wikipedia.org/wiki/Non-linear_least_squares#Convergence_criteria.
...
error = errorCalculation(
data,
parameters,
parameterizedFunction,
weightSquare,
);
converged = (previousError - error) / error <= errorTolerance; // <<<
if (isNaN(error)) break;
...
Metadata
Metadata
Assignees
Labels
No labels
Activity