Class LeastSquaresBuilder
java.lang.Object
org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresBuilder
A mutable builder for
LeastSquaresProblem
s.- See Also:
-
Constructor Summary
-
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.
-
Constructor Details
-
LeastSquaresBuilder
public LeastSquaresBuilder()Empty constructor.This constructor is not strictly necessary, but it prevents spurious javadoc warnings with JDK 18 and later.
- Since:
- 3.0
-
-
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 of
checker(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.
-
parameterValidator
Configure the validator of the model parameters.- Parameters:
newValidator
- Parameter validator.- Returns:
- this object.
-