Top Description Inners Constructors Methods
org.apache.commons.math3.fitting.leastsquares

public Class LeastSquaresFactory

extends Object
Class Inheritance
Imports
org.apache.commons.math3.exception.MathIllegalStateException, org.apache.commons.math3.exception.util.LocalizedFormats, org.apache.commons.math3.analysis.MultivariateMatrixFunction, .MultivariateVectorFunction, org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation, org.apache.commons.math3.linear.Array2DRowRealMatrix, .ArrayRealVector, .DiagonalMatrix, .EigenDecomposition, .RealMatrix, .RealVector, org.apache.commons.math3.optim.AbstractOptimizationProblem, .ConvergenceChecker, .PointVectorValuePair, org.apache.commons.math3.util.FastMath, .Incrementor, .Pair

A Factory for creating LeastSquaresProblems.
Since
3.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
LeastSquaresFactory.LocalLeastSquaresProblem

A private, "field" immutable (not "real" immutable) implementation of LeastSquaresProblem.

private static class

Constructor Summary

AccessConstructor and Description
private
LeastSquaresFactory()

Prevent instantiation.

Method Summary

Modifier and TypeMethod and Description
public static LeastSquaresProblem

Returns:

a least squares problem that tracks evaluations
countEvaluations
(final LeastSquaresProblem
the problem to track.
problem
,
final Incrementor
the counter to increment.
counter
)
Deprecated as a consequence of Incrementor being deprecated.

Count the evaluations of a particular problem.

public static LeastSquaresProblem

Returns:

the specified General Least Squares problem.
create
(final MultivariateJacobianFunction
the model function. Produces the computed values.
model
,
final RealVector
the observed (target) values
observed
,
final RealVector
the initial guess.
start
,
final RealMatrix
the weight matrix
weight
,
final ConvergenceChecker<LeastSquaresProblem.Evaluation>
convergence checker
checker
,
final int
the maximum number of times to evaluate the model
maxEvaluations
,
final int
the maximum number to times to iterate in the algorithm
maxIterations
,
final boolean
Whether the call to Evaluation#evaluate(RealVector) will defer the evaluation until access to the value is requested.
lazyEvaluation
,
final ParameterValidator
Model parameters validator.
paramValidator
)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements.

public static LeastSquaresProblem

Returns:

the specified General Least Squares problem.
create
(final MultivariateJacobianFunction
the model function. Produces the computed values.
model
,
final RealVector
the observed (target) values
observed
,
final RealVector
the initial guess.
start
,
final ConvergenceChecker<LeastSquaresProblem.Evaluation>
convergence checker
checker
,
final int
the maximum number of times to evaluate the model
maxEvaluations
,
final int
the maximum number to times to iterate in the algorithm
maxIterations
)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements.

public static LeastSquaresProblem

Returns:

the specified General Least Squares problem.
create
(final MultivariateJacobianFunction
the model function. Produces the computed values.
model
,
final RealVector
the observed (target) values
observed
,
final RealVector
the initial guess.
start
,
final RealMatrix
the weight matrix
weight
,
final ConvergenceChecker<LeastSquaresProblem.Evaluation>
convergence checker
checker
,
final int
the maximum number of times to evaluate the model
maxEvaluations
,
final int
the maximum number to times to iterate in the algorithm
maxIterations
)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements.

public static LeastSquaresProblem

Returns:

the specified General Least Squares problem.
create
(final MultivariateVectorFunction
the model function. Produces the computed values.
model
,
final MultivariateMatrixFunction
the jacobian of the model with respect to the parameters
jacobian
,
final double[]
the observed (target) values
observed
,
final double[]
the initial guess.
start
,
final RealMatrix
the weight matrix
weight
,
final ConvergenceChecker<LeastSquaresProblem.Evaluation>
convergence checker
checker
,
final int
the maximum number of times to evaluate the model
maxEvaluations
,
final int
the maximum number to times to iterate in the algorithm
maxIterations
)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements.

public static ConvergenceChecker<LeastSquaresProblem.Evaluation>

Returns:

a convergence checker that delegates to checker.
evaluationChecker
(final ConvergenceChecker<PointVectorValuePair>
the convergence checker to adapt.
checker
)

View a convergence checker specified for a PointVectorValuePair as one specified for an Evaluation.

public static MultivariateJacobianFunction

Returns:

a function that computes both at the same time
model
(final MultivariateVectorFunction
the vector value function
value
,
final MultivariateMatrixFunction
the Jacobian function
jacobian
)

Combine a MultivariateVectorFunction with a MultivariateMatrixFunction to produce a MultivariateJacobianFunction.

private static RealMatrix

Returns:

the square-root of the weight matrix.
squareRoot
(final RealMatrix
Symmetric, positive-definite (weight) matrix.
m
)

Computes the square-root of the weight matrix.

public static LeastSquaresProblem

Returns:

a new LeastSquaresProblem with the weights applied. The original problem is not modified.
weightDiagonal
(final LeastSquaresProblem
the unweighted problem
problem
,
final RealVector
the diagonal of the weight matrix
weights
)

Apply a diagonal weight matrix to the LeastSquaresProblem.

public static LeastSquaresProblem

Returns:

a new LeastSquaresProblem with the weights applied. The original problem is not modified.
weightMatrix
(final LeastSquaresProblem
the unweighted problem
problem
,
final RealMatrix
the matrix of weights
weights
)

Apply a dense weight matrix to the LeastSquaresProblem.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LeastSquaresFactoryback to summary
private LeastSquaresFactory()

Prevent instantiation.

Method Detail

countEvaluationsback to summary
public static LeastSquaresProblem countEvaluations(final LeastSquaresProblem problem, final Incrementor counter)

Deprecated

as a consequence of Incrementor being deprecated. See corresponding docs for further information.

Count the evaluations of a particular problem. The counter will be incremented every time LeastSquaresProblem#evaluate(RealVector) is called on the returned problem.

Parameters
problem:LeastSquaresProblem

the problem to track.

counter:Incrementor

the counter to increment.

Returns:LeastSquaresProblem

a least squares problem that tracks evaluations

createback to summary
public static LeastSquaresProblem create(final MultivariateJacobianFunction model, final RealVector observed, final RealVector start, final RealMatrix weight, final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, final int maxEvaluations, final int maxIterations, final boolean lazyEvaluation, final ParameterValidator paramValidator)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements. There will be no weights applied (unit weights).

Parameters
model:MultivariateJacobianFunction

the model function. Produces the computed values.

observed:RealVector

the observed (target) values

start:RealVector

the initial guess.

weight:RealMatrix

the weight matrix

checker:ConvergenceChecker<LeastSquaresProblem.Evaluation>

convergence checker

maxEvaluations:int

the maximum number of times to evaluate the model

maxIterations:int

the maximum number to times to iterate in the algorithm

lazyEvaluation:boolean

Whether the call to Evaluation#evaluate(RealVector) will defer the evaluation until access to the value is requested.

paramValidator:ParameterValidator

Model parameters validator.

Returns:LeastSquaresProblem

the specified General Least Squares problem.

Since
3.4
createback to summary
public static LeastSquaresProblem create(final MultivariateJacobianFunction model, final RealVector observed, final RealVector start, final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, final int maxEvaluations, final int maxIterations)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements. There will be no weights applied (unit weights).

Parameters
model:MultivariateJacobianFunction

the model function. Produces the computed values.

observed:RealVector

the observed (target) values

start:RealVector

the initial guess.

checker:ConvergenceChecker<LeastSquaresProblem.Evaluation>

convergence checker

maxEvaluations:int

the maximum number of times to evaluate the model

maxIterations:int

the maximum number to times to iterate in the algorithm

Returns:LeastSquaresProblem

the specified General Least Squares problem.

createback to summary
public static LeastSquaresProblem create(final MultivariateJacobianFunction model, final RealVector observed, final RealVector start, final RealMatrix weight, final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, final int maxEvaluations, final int maxIterations)

Create a org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem from the given elements.

Parameters
model:MultivariateJacobianFunction

the model function. Produces the computed values.

observed:RealVector

the observed (target) values

start:RealVector

the initial guess.

weight:RealMatrix

the weight matrix

checker:ConvergenceChecker<LeastSquaresProblem.Evaluation>

convergence checker

maxEvaluations:int

the maximum number of times to evaluate the model

maxIterations:int

the maximum number to times to iterate in the algorithm

Returns:LeastSquaresProblem

the specified General Least Squares problem.

createback to summary
public static LeastSquaresProblem create(final MultivariateVectorFunction model, final MultivariateMatrixFunction jacobian, final double[] observed, final double[] start, final RealMatrix weight, final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, final int maxEvaluations, final int maxIterations)

Create a org.apache.commons.math3.fitting.leastsquares.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).

Parameters
model:MultivariateVectorFunction

the model function. Produces the computed values.

jacobian:MultivariateMatrixFunction

the jacobian of the model with respect to the parameters

observed:double[]

the observed (target) values

start:double[]

the initial guess.

weight:RealMatrix

the weight matrix

checker:ConvergenceChecker<LeastSquaresProblem.Evaluation>

convergence checker

maxEvaluations:int

the maximum number of times to evaluate the model

maxIterations:int

the maximum number to times to iterate in the algorithm

Returns:LeastSquaresProblem

the specified General Least Squares problem.

evaluationCheckerback to summary
public static ConvergenceChecker<LeastSquaresProblem.Evaluation> evaluationChecker(final ConvergenceChecker<PointVectorValuePair> checker)

View a convergence checker specified for a PointVectorValuePair as one specified for an Evaluation.

Parameters
checker:ConvergenceChecker<PointVectorValuePair>

the convergence checker to adapt.

Returns:ConvergenceChecker<LeastSquaresProblem.Evaluation>

a convergence checker that delegates to checker.

modelback to summary
public static MultivariateJacobianFunction model(final MultivariateVectorFunction value, final MultivariateMatrixFunction jacobian)

Combine a MultivariateVectorFunction with a MultivariateMatrixFunction to produce a MultivariateJacobianFunction.

Parameters
value:MultivariateVectorFunction

the vector value function

jacobian:MultivariateMatrixFunction

the Jacobian function

Returns:MultivariateJacobianFunction

a function that computes both at the same time

squareRootback to summary
private static RealMatrix squareRoot(final RealMatrix m)

Computes the square-root of the weight matrix.

Parameters
m:RealMatrix

Symmetric, positive-definite (weight) matrix.

Returns:RealMatrix

the square-root of the weight matrix.

weightDiagonalback to summary
public static LeastSquaresProblem weightDiagonal(final LeastSquaresProblem problem, final RealVector weights)

Apply a diagonal weight matrix to the LeastSquaresProblem.

Parameters
problem:LeastSquaresProblem

the unweighted problem

weights:RealVector

the diagonal of the weight matrix

Returns:LeastSquaresProblem

a new LeastSquaresProblem with the weights applied. The original problem is not modified.

weightMatrixback to summary
public static LeastSquaresProblem weightMatrix(final LeastSquaresProblem problem, final RealMatrix weights)

Apply a dense weight matrix to the LeastSquaresProblem.

Parameters
problem:LeastSquaresProblem

the unweighted problem

weights:RealMatrix

the matrix of weights

Returns:LeastSquaresProblem

a new LeastSquaresProblem with the weights applied. The original problem is not modified.

org.apache.commons.math3.fitting.leastsquares back to summary

private Class LeastSquaresFactory.LocalLeastSquaresProblem

extends AbstractOptimizationProblem<LeastSquaresProblem.Evaluation>
implements LeastSquaresProblem
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem, org.apache.commons.math3.optim.OptimizationProblem

A private, "field" immutable (not "real" immutable) implementation of LeastSquaresProblem.
Since
3.3

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
LeastSquaresFactory.LocalLeastSquaresProblem.LazyUnweightedEvaluation

Container with the model lazy evaluation at a particular point.

private static class
LeastSquaresFactory.LocalLeastSquaresProblem.UnweightedEvaluation

Container with the model evaluation at a particular point.

Field Summary

Modifier and TypeField and Description
private final boolean
lazyEvaluation

Whether to use lazy evaluation.

private final MultivariateJacobianFunction
model

Model function.

private final ParameterValidator
paramValidator

Model parameters validator.

private final RealVector
start

Initial guess.

private final RealVector
target

Target values for the model function at optimum.

Constructor Summary

AccessConstructor and Description
pack-priv
LocalLeastSquaresProblem(final MultivariateJacobianFunction
the model function
model
,
final RealVector
the observed data
target
,
final RealVector
the initial guess
start
,
final ConvergenceChecker<LeastSquaresProblem.Evaluation>
the convergence checker
checker
,
final int
the allowed evaluations
maxEvaluations
,
final int
the allowed iterations
maxIterations
,
final boolean
Whether the call to Evaluation#evaluate(RealVector) will defer the evaluation until access to the value is requested.
lazyEvaluation
,
final ParameterValidator
Model parameters validator.
paramValidator
)

Create a LeastSquaresProblem from the given data.

Method Summary

Modifier and TypeMethod and Description
public LeastSquaresProblem.Evaluation
evaluate(final RealVector
the parameter values.
point
)

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.evaluate.

Evaluate the model at the specified point.

public int
getObservationSize()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getObservationSize.

Get the number of observations (rows in the Jacobian) in this problem.

public int
getParameterSize()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getParameterSize.

Get the number of parameters (columns in the Jacobian) in this problem.

public RealVector
Inherited from org.apache.commons.math3.optim.AbstractOptimizationProblem:
getConvergenceCheckergetEvaluationCountergetIterationCounter

Field Detail

lazyEvaluationback to summary
private final boolean lazyEvaluation

Whether to use lazy evaluation.

modelback to summary
private final MultivariateJacobianFunction model

Model function.

paramValidatorback to summary
private final ParameterValidator paramValidator

Model parameters validator.

startback to summary
private final RealVector start

Initial guess.

targetback to summary
private final RealVector target

Target values for the model function at optimum.

Constructor Detail

LocalLeastSquaresProblemback to summary
pack-priv LocalLeastSquaresProblem(final MultivariateJacobianFunction model, final RealVector target, final RealVector start, final ConvergenceChecker<LeastSquaresProblem.Evaluation> checker, final int maxEvaluations, final int maxIterations, final boolean lazyEvaluation, final ParameterValidator paramValidator)

Create a LeastSquaresProblem from the given data.

Parameters
model:MultivariateJacobianFunction

the model function

target:RealVector

the observed data

start:RealVector

the initial guess

checker:ConvergenceChecker<LeastSquaresProblem.Evaluation>

the convergence checker

maxEvaluations:int

the allowed evaluations

maxIterations:int

the allowed iterations

lazyEvaluation:boolean

Whether the call to Evaluation#evaluate(RealVector) will defer the evaluation until access to the value is requested.

paramValidator:ParameterValidator

Model parameters validator.

Method Detail

evaluateback to summary
public LeastSquaresProblem.Evaluation evaluate(final RealVector point)

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.evaluate.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.evaluate.

Evaluate the model at the specified point.

Parameters
point:RealVector

the parameter values.

Returns:LeastSquaresProblem.Evaluation

the model's value and derivative at the given point.

getObservationSizeback to summary
public int getObservationSize()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getObservationSize.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getObservationSize.

Get the number of observations (rows in the Jacobian) in this problem.

Returns:int

the number of scalar observations

getParameterSizeback to summary
public int getParameterSize()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getParameterSize.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getParameterSize.

Get the number of parameters (columns in the Jacobian) in this problem.

Returns:int

the number of scalar parameters

getStartback to summary
public RealVector getStart()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getStart.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.getStart.

Gets the initial guess.

Returns:RealVector

the initial guess values.

org.apache.commons.math3.fitting.leastsquares back to summary

private Class LeastSquaresFactory.LocalLeastSquaresProblem.LazyUnweightedEvaluation

extends AbstractEvaluation
Class Inheritance

Container with the model lazy evaluation at a particular point.

Field Summary

Modifier and TypeField and Description
private final ValueAndJacobianFunction
model

Model and Jacobian functions.

private final RealVector
point

Point of evaluation.

private final RealVector
target

Target values for the model function at optimum.

Constructor Summary

AccessConstructor and Description
private
LazyUnweightedEvaluation(final ValueAndJacobianFunction
the model function
model
,
final RealVector
the observed values
target
,
final RealVector
the abscissa
point
)

Create an Evaluation with no weights.

Field Detail

modelback to summary
private final ValueAndJacobianFunction model

Model and Jacobian functions.

pointback to summary
private final RealVector point

Point of evaluation.

targetback to summary
private final RealVector target

Target values for the model function at optimum.

Constructor Detail

LazyUnweightedEvaluationback to summary
private LazyUnweightedEvaluation(final ValueAndJacobianFunction model, final RealVector target, final RealVector point)

Create an Evaluation with no weights.

Parameters
model:ValueAndJacobianFunction

the model function

target:RealVector

the observed values

point:RealVector

the abscissa

Method Detail

getJacobianback to summary
public RealMatrix getJacobian()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getJacobian.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getJacobian.

Get the weighted Jacobian matrix.

Returns:RealMatrix

the weighted Jacobian: W1/2 J.

getPointback to summary
public RealVector getPoint()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getPoint.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getPoint.

Get the abscissa (independent variables) of this evaluation.

Returns:RealVector

the point provided to evaluate(RealVector).

getResidualsback to summary
public RealVector getResiduals()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getResiduals.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getResiduals.

Get the weighted residuals. The residual is the difference between the observed (target) values and the model (objective function) value. There is one residual for each element of the vector-valued function. The raw residuals are then multiplied by the square root of the weight matrix.

Returns:RealVector

the weighted residuals: W1/2 K.

org.apache.commons.math3.fitting.leastsquares back to summary

private Class LeastSquaresFactory.LocalLeastSquaresProblem.UnweightedEvaluation

extends AbstractEvaluation
Class Inheritance

Container with the model evaluation at a particular point.

Field Summary

Modifier and TypeField and Description
private final RealMatrix
jacobian

Derivative at point.

private final RealVector
point

Point of evaluation.

private final RealVector
residuals

Computed residuals.

Constructor Summary

AccessConstructor and Description
private
UnweightedEvaluation(final RealVector
the computed function values
values
,
final RealMatrix
the computed function Jacobian
jacobian
,
final RealVector
the observed values
target
,
final RealVector
the abscissa
point
)

Create an Evaluation with no weights.

Field Detail

jacobianback to summary
private final RealMatrix jacobian

Derivative at point.

pointback to summary
private final RealVector point

Point of evaluation.

residualsback to summary
private final RealVector residuals

Computed residuals.

Constructor Detail

UnweightedEvaluationback to summary
private UnweightedEvaluation(final RealVector values, final RealMatrix jacobian, final RealVector target, final RealVector point)

Create an Evaluation with no weights.

Parameters
values:RealVector

the computed function values

jacobian:RealMatrix

the computed function Jacobian

target:RealVector

the observed values

point:RealVector

the abscissa

Method Detail

getJacobianback to summary
public RealMatrix getJacobian()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getJacobian.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getJacobian.

Get the weighted Jacobian matrix.

Returns:RealMatrix

the weighted Jacobian: W1/2 J.

getPointback to summary
public RealVector getPoint()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getPoint.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getPoint.

Get the abscissa (independent variables) of this evaluation.

Returns:RealVector

the point provided to evaluate(RealVector).

getResidualsback to summary
public RealVector getResiduals()

Implements org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getResiduals.

Doc from org.apache.commons.math3.fitting.leastsquares.LeastSquaresProblem.Evaluation.getResiduals.

Get the weighted residuals. The residual is the difference between the observed (target) values and the model (objective function) value. There is one residual for each element of the vector-valued function. The raw residuals are then multiplied by the square root of the weight matrix.

Returns:RealVector

the weighted residuals: W1/2 K.

org.apache.commons.math3.fitting.leastsquares back to summary

private Class LeastSquaresFactory.LocalValueAndJacobianFunction

extends Object
implements ValueAndJacobianFunction
Class Inheritance
  • java.lang.Object
  • org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.LocalValueAndJacobianFunction
All Implemented Interfaces
org.apache.commons.math3.fitting.leastsquares.ValueAndJacobianFunction, org.apache.commons.math3.fitting.leastsquares.MultivariateJacobianFunction

Combine a MultivariateVectorFunction with a MultivariateMatrixFunction to produce a MultivariateJacobianFunction.

Field Summary

Modifier and TypeField and Description
private final MultivariateMatrixFunction
jacobian

Model's Jacobian.

private final MultivariateVectorFunction
value

Model.

Constructor Summary

AccessConstructor and Description
pack-priv
LocalValueAndJacobianFunction(final MultivariateVectorFunction
Model function.
value
,
final MultivariateMatrixFunction
Model's Jacobian function.
jacobian
)

Method Summary

Modifier and TypeMethod and Description
public RealMatrix
public RealVector
public Pair<RealVector, RealMatrix>
value(final RealVector
the abscissae
point
)

Implements org.apache.commons.math3.fitting.leastsquares.MultivariateJacobianFunction.value.

Compute the function value and its Jacobian.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

jacobianback to summary
private final MultivariateMatrixFunction jacobian

Model's Jacobian.

valueback to summary
private final MultivariateVectorFunction value

Model.

Constructor Detail

LocalValueAndJacobianFunctionback to summary
pack-priv LocalValueAndJacobianFunction(final MultivariateVectorFunction value, final MultivariateMatrixFunction jacobian)
Parameters
value:MultivariateVectorFunction

Model function.

jacobian:MultivariateMatrixFunction

Model's Jacobian function.

Method Detail

computeJacobianback to summary
public RealMatrix computeJacobian(final double[] params)

Implements org.apache.commons.math3.fitting.leastsquares.ValueAndJacobianFunction.computeJacobian.

Doc from org.apache.commons.math3.fitting.leastsquares.ValueAndJacobianFunction.computeJacobian.

Compute the Jacobian.

Parameters
params:double[]

Point.

Returns:RealMatrix

the Jacobian at the given point.

computeValueback to summary
public RealVector computeValue(final double[] params)

Implements org.apache.commons.math3.fitting.leastsquares.ValueAndJacobianFunction.computeValue.

Doc from org.apache.commons.math3.fitting.leastsquares.ValueAndJacobianFunction.computeValue.

Compute the value.

Parameters
params:double[]

Point.

Returns:RealVector

the value at the given point.

valueback to summary
public Pair<RealVector, RealMatrix> value(final RealVector point)

Implements org.apache.commons.math3.fitting.leastsquares.MultivariateJacobianFunction.value.

Doc from org.apache.commons.math3.fitting.leastsquares.MultivariateJacobianFunction.value.

Compute the function value and its Jacobian.

Parameters
point:RealVector

the abscissae

Returns:Pair<RealVector, RealMatrix>

the values and their Jacobian of this vector valued function.