Class LeastSquaresBuilder
java.lang.Object
org.apache.commons.math3.fitting.leastsquares.LeastSquaresBuilder
A mutable builder for
LeastSquaresProblem
s.- Since:
- 3.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionconvergence checkerprivate boolean
Lazy evaluation.private int
max evaluationsprivate int
max iterationsprivate MultivariateJacobianFunction
model functionprivate ParameterValidator
Validator.private RealVector
initial guessprivate RealVector
observed valuesprivate RealMatrix
weight matrix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Construct aLeastSquaresProblem
from the data in this builder.checker
(ConvergenceChecker<LeastSquaresProblem.Evaluation> newChecker) Configure the convergence checker.checkerPair
(ConvergenceChecker<PointVectorValuePair> newChecker) Configure the convergence checker.lazyEvaluation
(boolean newValue) Configure whether evaluation will be lazy or not.maxEvaluations
(int newMaxEvaluations) Configure the max evaluations.maxIterations
(int newMaxIterations) Configure the max iterations.model
(MultivariateVectorFunction value, MultivariateMatrixFunction jacobian) Configure the model function.model
(MultivariateJacobianFunction newModel) Configure the model function.parameterValidator
(ParameterValidator newValidator) Configure the validator of the model parameters.start
(double[] newStart) Configure the initial guess.start
(RealVector newStart) Configure the initial guess.target
(double[] newTarget) Configure the observed data.target
(RealVector newTarget) Configure the observed data.weight
(RealMatrix newWeight) Configure the weight matrix.
-
Field Details
-
maxEvaluations
private int maxEvaluationsmax evaluations -
maxIterations
private int maxIterationsmax iterations -
checker
convergence checker -
model
model function -
target
observed values -
start
initial guess -
weight
weight matrix -
lazyEvaluation
private boolean lazyEvaluationLazy evaluation.- Since:
- 3.4
-
paramValidator
Validator.- Since:
- 3.4
-
-
Constructor Details
-
LeastSquaresBuilder
public LeastSquaresBuilder()
-
-
Method Details
-
build
Construct aLeastSquaresProblem
from the data in this builder.- Returns:
- a new
LeastSquaresProblem
.
-
maxEvaluations
Configure the max evaluations.- Parameters:
newMaxEvaluations
- the maximum number of evaluations permitted.- Returns:
- this
-
maxIterations
Configure the max iterations.- Parameters:
newMaxIterations
- the maximum number of iterations permitted.- Returns:
- this
-
checker
Configure the convergence checker.- Parameters:
newChecker
- the convergence checker.- Returns:
- this
-
checkerPair
Configure the convergence checker. This function is an overloaded version ofchecker(ConvergenceChecker)
.- Parameters:
newChecker
- the convergence checker.- Returns:
- this
-
model
public LeastSquaresBuilder model(MultivariateVectorFunction value, MultivariateMatrixFunction jacobian) Configure the model function.- Parameters:
value
- the model function valuejacobian
- the Jacobian ofvalue
- Returns:
- this
-
model
Configure the model function.- Parameters:
newModel
- the model function value and Jacobian- Returns:
- this
-
target
Configure the observed data.- Parameters:
newTarget
- the observed data.- Returns:
- this
-
target
Configure the observed data.- Parameters:
newTarget
- the observed data.- Returns:
- this
-
start
Configure the initial guess.- Parameters:
newStart
- the initial guess.- Returns:
- this
-
start
Configure the initial guess.- Parameters:
newStart
- the initial guess.- Returns:
- this
-
weight
Configure the weight matrix.- Parameters:
newWeight
- the weight matrix- Returns:
- this
-
lazyEvaluation
Configure whether evaluation will be lazy or not.- Parameters:
newValue
- Whether to perform lazy evaluation.- Returns:
- this object.
- Since:
- 3.4
-
parameterValidator
Configure the validator of the model parameters.- Parameters:
newValidator
- Parameter validator.- Returns:
- this object.
- Since:
- 3.4
-