Class LeastSquaresBuilder
- java.lang.Object
-
- org.apache.commons.math4.legacy.fitting.leastsquares.LeastSquaresBuilder
-
public class LeastSquaresBuilder extends Object
A mutable builder forLeastSquaresProblem
s.- Since:
- 3.3
- See Also:
LeastSquaresFactory
-
-
Constructor Summary
Constructors Constructor Description LeastSquaresBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LeastSquaresProblem
build()
Construct aLeastSquaresProblem
from the data in this builder.LeastSquaresBuilder
checker(ConvergenceChecker<LeastSquaresProblem.Evaluation> newChecker)
Configure the convergence checker.LeastSquaresBuilder
checkerPair(ConvergenceChecker<PointVectorValuePair> newChecker)
Configure the convergence checker.LeastSquaresBuilder
lazyEvaluation(boolean newValue)
Configure whether evaluation will be lazy or not.LeastSquaresBuilder
maxEvaluations(int newMaxEvaluations)
Configure the max evaluations.LeastSquaresBuilder
maxIterations(int newMaxIterations)
Configure the max iterations.LeastSquaresBuilder
model(MultivariateVectorFunction value, MultivariateMatrixFunction jacobian)
Configure the model function.LeastSquaresBuilder
model(MultivariateJacobianFunction newModel)
Configure the model function.LeastSquaresBuilder
parameterValidator(ParameterValidator newValidator)
Configure the validator of the model parameters.LeastSquaresBuilder
start(double[] newStart)
Configure the initial guess.LeastSquaresBuilder
start(RealVector newStart)
Configure the initial guess.LeastSquaresBuilder
target(double[] newTarget)
Configure the observed data.LeastSquaresBuilder
target(RealVector newTarget)
Configure the observed data.LeastSquaresBuilder
weight(RealMatrix newWeight)
Configure the weight matrix.
-
-
-
Constructor Detail
-
LeastSquaresBuilder
public LeastSquaresBuilder()
-
-
Method Detail
-
build
public LeastSquaresProblem build()
Construct aLeastSquaresProblem
from the data in this builder.- Returns:
- a new
LeastSquaresProblem
.
-
maxEvaluations
public LeastSquaresBuilder maxEvaluations(int newMaxEvaluations)
Configure the max evaluations.- Parameters:
newMaxEvaluations
- the maximum number of evaluations permitted.- Returns:
- this
-
maxIterations
public LeastSquaresBuilder maxIterations(int newMaxIterations)
Configure the max iterations.- Parameters:
newMaxIterations
- the maximum number of iterations permitted.- Returns:
- this
-
checker
public LeastSquaresBuilder checker(ConvergenceChecker<LeastSquaresProblem.Evaluation> newChecker)
Configure the convergence checker.- Parameters:
newChecker
- the convergence checker.- Returns:
- this
-
checkerPair
public LeastSquaresBuilder checkerPair(ConvergenceChecker<PointVectorValuePair> newChecker)
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
public LeastSquaresBuilder model(MultivariateJacobianFunction newModel)
Configure the model function.- Parameters:
newModel
- the model function value and Jacobian- Returns:
- this
-
target
public LeastSquaresBuilder target(RealVector newTarget)
Configure the observed data.- Parameters:
newTarget
- the observed data.- Returns:
- this
-
target
public LeastSquaresBuilder target(double[] newTarget)
Configure the observed data.- Parameters:
newTarget
- the observed data.- Returns:
- this
-
start
public LeastSquaresBuilder start(RealVector newStart)
Configure the initial guess.- Parameters:
newStart
- the initial guess.- Returns:
- this
-
start
public LeastSquaresBuilder start(double[] newStart)
Configure the initial guess.- Parameters:
newStart
- the initial guess.- Returns:
- this
-
weight
public LeastSquaresBuilder weight(RealMatrix newWeight)
Configure the weight matrix.- Parameters:
newWeight
- the weight matrix- Returns:
- this
-
lazyEvaluation
public LeastSquaresBuilder lazyEvaluation(boolean newValue)
Configure whether evaluation will be lazy or not.- Parameters:
newValue
- Whether to perform lazy evaluation.- Returns:
- this object.
- Since:
- 3.4
-
parameterValidator
public LeastSquaresBuilder parameterValidator(ParameterValidator newValidator)
Configure the validator of the model parameters.- Parameters:
newValidator
- Parameter validator.- Returns:
- this object.
- Since:
- 3.4
-
-