Class LeastSquaresBuilder
- java.lang.Object
-
- org.apache.commons.math4.legacy.fitting.leastsquares.LeastSquaresBuilder
-
public class LeastSquaresBuilder extends Object
A mutable builder forLeastSquaresProblems.- 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 LeastSquaresProblembuild()Construct aLeastSquaresProblemfrom the data in this builder.LeastSquaresBuilderchecker(ConvergenceChecker<LeastSquaresProblem.Evaluation> newChecker)Configure the convergence checker.LeastSquaresBuildercheckerPair(ConvergenceChecker<PointVectorValuePair> newChecker)Configure the convergence checker.LeastSquaresBuilderlazyEvaluation(boolean newValue)Configure whether evaluation will be lazy or not.LeastSquaresBuildermaxEvaluations(int newMaxEvaluations)Configure the max evaluations.LeastSquaresBuildermaxIterations(int newMaxIterations)Configure the max iterations.LeastSquaresBuildermodel(MultivariateVectorFunction value, MultivariateMatrixFunction jacobian)Configure the model function.LeastSquaresBuildermodel(MultivariateJacobianFunction newModel)Configure the model function.LeastSquaresBuilderparameterValidator(ParameterValidator newValidator)Configure the validator of the model parameters.LeastSquaresBuilderstart(double[] newStart)Configure the initial guess.LeastSquaresBuilderstart(RealVector newStart)Configure the initial guess.LeastSquaresBuildertarget(double[] newTarget)Configure the observed data.LeastSquaresBuildertarget(RealVector newTarget)Configure the observed data.LeastSquaresBuilderweight(RealMatrix newWeight)Configure the weight matrix.
-
-
-
Constructor Detail
-
LeastSquaresBuilder
public LeastSquaresBuilder()
-
-
Method Detail
-
build
public LeastSquaresProblem build()
Construct aLeastSquaresProblemfrom 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
-
-