vectorial objective functions to
scalar objective functions
when the goal is to minimize them.
MultivariateFunction interface and can therefore be
minimized by any optimizer supporting scalar objectives functions.This is one way
to perform a least square estimation. There are other ways to do this without using
this converter, as some optimization algorithms directly support vectorial objective
functions.
MultivariateFunction, MultivariateVectorFunction
| Modifier and Type | Field and Description |
|---|---|
| private final MultivariateVectorFunction | function
Underlying vectorial function. |
| private final double[] | observations
Observations to be compared to objective function to compute residuals. |
| private final RealMatrix | scale
Optional scaling matrix (weight and correlations) for the residuals. |
| private final double[] | weights
Optional weights for the residuals. |
| Access | Constructor and Description |
|---|---|
| public | LeastSquaresConverter(final MultivariateVectorFunction
vectorial residuals function to wrap function, final double[] observations to be compared to objective function to compute residuals observations)Builds a simple converter for uncorrelated residuals with identical weights. |
| public | LeastSquaresConverter(final MultivariateVectorFunction
vectorial residuals function to wrap function, final double[] observations to be compared to objective function to compute residuals observations, final double[] weights to apply to the residuals weights)Builds a simple converter for uncorrelated residuals with the specified weights. |
| public | LeastSquaresConverter(final MultivariateVectorFunction
vectorial residuals function to wrap function, final double[] observations to be compared to objective function to compute residuals observations, final RealMatrix scaling matrix scale)Builds a simple converter for correlated residuals with the specified weights. |
| Modifier and Type | Method and Description |
|---|---|
| public double | value(final double[]
Point at which the function must be evaluated. point)Implements org. Compute the value for the function at the given point. |
| function | back to summary |
|---|---|
| private final MultivariateVectorFunction function Underlying vectorial function. | |
| observations | back to summary |
|---|---|
| private final double[] observations Observations to be compared to objective function to compute residuals. | |
| scale | back to summary |
|---|---|
| private final RealMatrix scale Optional scaling matrix (weight and correlations) for the residuals. | |
| weights | back to summary |
|---|---|
| private final double[] weights Optional weights for the residuals. | |
| LeastSquaresConverter | back to summary |
|---|---|
| public LeastSquaresConverter(final MultivariateVectorFunction function, final double[] observations) Builds a simple converter for uncorrelated residuals with identical weights.
| |
| LeastSquaresConverter | back to summary |
|---|---|
| public LeastSquaresConverter(final MultivariateVectorFunction function, final double[] observations, final double[] weights) Builds a simple converter for uncorrelated residuals with the specified weights. The scalar objective function value is computed as: objective = ∑weighti(observationi-objectivei)2 Weights can be used for example to combine residuals with different standard deviations. As an example, consider a residuals array in which even elements are angular measurements in degrees with a 0.01° standard deviation and odd elements are distance measurements in meters with a 15m standard deviation. In this case, the weights array should be initialized with value 1.0/(0.012) in the even elements and 1.0/(15.02) in the odd elements (i.e. reciprocals of variances).
The array computed by the objective function, the observations array and the
weights array must have consistent sizes or a
| |
| LeastSquaresConverter | back to summary |
|---|---|
| public LeastSquaresConverter(final MultivariateVectorFunction function, final double[] observations, final RealMatrix scale) Builds a simple converter for correlated residuals with the specified weights. The scalar objective function value is computed as: objective = yTy with y = scale×(observation-objective)
The array computed by the objective function, the observations array and the
the scaling matrix must have consistent sizes or a
| |
| value | back to summary |
|---|---|
| public double value(final double[] point) Implements org. Doc from org. Compute the value for the function at the given point.
| |