## org.apache.commons.math.optimization.general
Class GaussNewtonOptimizer

    java.lang.Object
      org.apache.commons.math.optimization.general.AbstractLeastSquaresOptimizer
          org.apache.commons.math.optimization.general.GaussNewtonOptimizer

All Implemented Interfaces:
  DifferentiableMultivariateVectorialOptimizer

    public class GaussNewtonOptimizer

extends AbstractLeastSquaresOptimizer

Gauss-Newton least-squares solver.

This class solve a least-square problem by solving the normal equations of the linearized problem at each iteration. Either LU decomposition or QR decomposition can be used to solve the normal equations. LU decomposition is faster but QR decomposition is more robust for difficult problems.

Since:
  2.0
Version:
  $Revision: 811685 $ $Date: 2009-09-05 13:36:48 -0400 (Sat, 05 Sep 2009) $

Field Summary
`private boolean` `useLU` Indicator for using LU decomposition.

Fields inherited from class org.apache.commons.math.optimization.general.AbstractLeastSquaresOptimizer
`checker, cols, cost, DEFAULT_MAX_ITERATIONS, jacobian, objective, point, residuals, residualsWeights, rows, targetValues`

Constructor Summary
`GaussNewtonOptimizer(boolean useLU)` Simple constructor with default settings.

Method Summary
`VectorialPointValuePair` `doOptimize()` Perform the bulk of optimization algorithm.

Methods inherited from class org.apache.commons.math.optimization.general.AbstractLeastSquaresOptimizer
`getChiSquare, getConvergenceChecker, getCovariances, getEvaluations, getIterations, getJacobianEvaluations, getMaxEvaluations, getMaxIterations, getRMS, guessParametersErrors, incrementIterationsCounter, optimize, setConvergenceChecker, setMaxEvaluations, setMaxIterations, updateJacobian, updateResidualsAndCost`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### useLU

    private final boolean useLU

  Indicator for using LU decomposition.

Constructor Detail

### GaussNewtonOptimizer

    public GaussNewtonOptimizer(boolean useLU)

  Simple constructor with default settings.

  The convergence check is set to a `SimpleVectorialValueChecker` and the maximal number of evaluation is set to `AbstractLeastSquaresOptimizer.DEFAULT_MAX_ITERATIONS`.

  Parameters:
    `useLU` - if true, the normal equations will be solved using LU decomposition, otherwise they will be solved using QR decomposition

Method Detail

### doOptimize

    public VectorialPointValuePair doOptimize()
                                       throws FunctionEvaluationException,
                                              OptimizationException,
                                              java.lang.IllegalArgumentException

  Perform the bulk of optimization algorithm.

  Specified by:
    `doOptimize` in class `AbstractLeastSquaresOptimizer`
  Returns:
    the point/value pair giving the optimal value for objective function
  Throws:
    `FunctionEvaluationException` - if the objective function throws one during the search
    `OptimizationException` - if the algorithm failed to converge
    `java.lang.IllegalArgumentException` - if the start point dimension is wrong

Copyright (c) 2003-2011 Apache Software Foundation