public class LeastSquaresFactory extends Object
LeastSquaresProblem
s.public static LeastSquaresProblem create(MultivariateJacobianFunction model, RealVector observed, RealVector start, RealMatrix weight, ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, int maxEvaluations, int maxIterations, boolean lazyEvaluation, ParameterValidator paramValidator)
LeastSquaresProblem
from the given elements. There will be no weights applied (unit weights).model
- the model function. Produces the computed values.observed
- the observed (target) valuesstart
- the initial guess.weight
- the weight matrixchecker
- convergence checkermaxEvaluations
- the maximum number of times to evaluate the modelmaxIterations
- the maximum number to times to iterate in the algorithmlazyEvaluation
- Whether the call to LeastSquaresProblem.evaluate(RealVector)
will defer the evaluation until access to the value is requested.paramValidator
- Model parameters validator.public static LeastSquaresProblem create(MultivariateJacobianFunction model, RealVector observed, RealVector start, ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, int maxEvaluations, int maxIterations)
LeastSquaresProblem
from the given elements. There will be no weights applied (unit weights).model
- the model function. Produces the computed values.observed
- the observed (target) valuesstart
- the initial guess.checker
- convergence checkermaxEvaluations
- the maximum number of times to evaluate the modelmaxIterations
- the maximum number to times to iterate in the algorithmpublic static LeastSquaresProblem create(MultivariateJacobianFunction model, RealVector observed, RealVector start, RealMatrix weight, ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, int maxEvaluations, int maxIterations)
LeastSquaresProblem
from the given elements.model
- the model function. Produces the computed values.observed
- the observed (target) valuesstart
- the initial guess.weight
- the weight matrixchecker
- convergence checkermaxEvaluations
- the maximum number of times to evaluate the modelmaxIterations
- the maximum number to times to iterate in the algorithmpublic static LeastSquaresProblem create(MultivariateVectorFunction model, MultivariateMatrixFunction jacobian, double[] observed, double[] start, RealMatrix weight, ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, int maxEvaluations, int maxIterations)
LeastSquaresProblem
from the given elements.
This factory method is provided for continuity with previous interfaces. Newer
applications should use create(MultivariateJacobianFunction, RealVector,
RealVector, ConvergenceChecker, int, int)
, or create(MultivariateJacobianFunction,
RealVector, RealVector, RealMatrix, ConvergenceChecker, int, int)
.
model
- the model function. Produces the computed values.jacobian
- the jacobian of the model with respect to the parametersobserved
- the observed (target) valuesstart
- the initial guess.weight
- the weight matrixchecker
- convergence checkermaxEvaluations
- the maximum number of times to evaluate the modelmaxIterations
- the maximum number to times to iterate in the algorithmpublic static LeastSquaresProblem weightMatrix(LeastSquaresProblem problem, RealMatrix weights)
LeastSquaresProblem
.problem
- the unweighted problemweights
- the matrix of weightsLeastSquaresProblem
with the weights applied. The original
problem
is not modified.public static LeastSquaresProblem weightDiagonal(LeastSquaresProblem problem, RealVector weights)
LeastSquaresProblem
.problem
- the unweighted problemweights
- the diagonal of the weight matrixLeastSquaresProblem
with the weights applied. The original
problem
is not modified.public static LeastSquaresProblem countEvaluations(LeastSquaresProblem problem, Incrementor counter)
counter
will be
incremented every time LeastSquaresProblem.evaluate(RealVector)
is called on
the returned problem.problem
- the problem to track.counter
- the counter to increment.public static ConvergenceChecker<LeastSquaresProblem.Evaluation> evaluationChecker(ConvergenceChecker<PointVectorValuePair> checker)
PointVectorValuePair
as one
specified for an LeastSquaresProblem.Evaluation
.checker
- the convergence checker to adapt.checker
.public static MultivariateJacobianFunction model(MultivariateVectorFunction value, MultivariateMatrixFunction jacobian)
MultivariateVectorFunction
with a MultivariateMatrixFunction
to produce a MultivariateJacobianFunction
.value
- the vector value functionjacobian
- the Jacobian functionCopyright © 2016 Hipparchus.org. All rights reserved.