Top Description Fields Constructors Methods
org.apache.commons.math3.fitting.leastsquares

public Class EvaluationRmsChecker

extends Object
implements ConvergenceChecker<LeastSquaresProblem.Evaluation>
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optim.ConvergenceChecker
Imports
org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation, org.apache.commons.math3.optim.ConvergenceChecker, org.apache.commons.math3.util.Precision

Check if an optimization has converged based on the change in computed RMS.
Since
3.4

Field Summary

Modifier and TypeField and Description
private final double
absTol

absolute tolerance for comparisons.

private final double
relTol

relative tolerance for comparisons.

Constructor Summary

AccessConstructor and Description
public
EvaluationRmsChecker(final double
the relative and absolute tolerance.
tol
)

Create a convergence checker for the RMS with the same relative and absolute tolerance.

public
EvaluationRmsChecker(final double
the relative tolerance.
relTol
,
final double
the absolute tolerance.
absTol
)

Create a convergence checker for the RMS with a relative and absolute tolerance.

Method Summary

Modifier and TypeMethod and Description
public boolean
converged(final int
Current iteration.
iteration
,
final LeastSquaresProblem.Evaluation
Best point in the previous iteration.
previous
,
final LeastSquaresProblem.Evaluation
Best point in the current iteration.
current
)

Implements org.apache.commons.math3.optim.ConvergenceChecker.converged.

Check if the optimization algorithm has converged.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

absTolback to summary
private final double absTol

absolute tolerance for comparisons.

relTolback to summary
private final double relTol

relative tolerance for comparisons.

Constructor Detail

EvaluationRmsCheckerback to summary
public EvaluationRmsChecker(final double tol)

Create a convergence checker for the RMS with the same relative and absolute tolerance.

Convenience constructor for when the relative and absolute tolerances are the same. Same as new EvaluationRmsChecker(tol, tol).

Parameters
tol:double

the relative and absolute tolerance.

See Also
EvaluationRmsChecker(double, double)
EvaluationRmsCheckerback to summary
public EvaluationRmsChecker(final double relTol, final double absTol)

Create a convergence checker for the RMS with a relative and absolute tolerance.

The optimization has converged when the RMS of consecutive evaluations are equal to within the given relative tolerance or absolute tolerance.

Parameters
relTol:double

the relative tolerance.

absTol:double

the absolute tolerance.

See Also
Precision#equals(double, double, double), Precision#equalsWithRelativeTolerance(double, double, double)

Method Detail

convergedback to summary
public boolean converged(final int iteration, final LeastSquaresProblem.Evaluation previous, final LeastSquaresProblem.Evaluation current)

Implements org.apache.commons.math3.optim.ConvergenceChecker.converged.

Doc from org.apache.commons.math3.optim.ConvergenceChecker.converged.

Check if the optimization algorithm has converged.

Parameters
iteration:int

Current iteration.

previous:LeastSquaresProblem.Evaluation

Best point in the previous iteration.

current:LeastSquaresProblem.Evaluation

Best point in the current iteration.

Returns:boolean

true if the algorithm is considered to have converged.