|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.numeric.NonLinearLeastSquares
public class NonLinearLeastSquares
Class NonLinearLeastSquares provides a method for minimizing the sum of the squares of a series of nonlinear functions. There are M functions, each of which has N inputs. These functions are represented by an object that implements interface VectorFunction. The solve() method finds a vector x such that Σi [fi(x)]2 is minimized. The inputs to and outputs from the solve() method are stored in the fields of an instance of class NonLinearLeastSquares. The Levenberg-Marquardt method is used to find the solution.
The Java code is a translation of the Fortran subroutine LMDER from the MINPACK library. MINPACK was developed by Jorge Moré, Burt Garbow, and Ken Hillstrom at Argonne National Laboratory. For further information, see http://www.netlib.org/minpack/.
Field Summary | |
---|---|
VectorFunction |
fcn
The nonlinear functions fi(x) to be minimized. |
double[][] |
fjac
The M×N-element Jacobian matrix. |
double[] |
fvec
The M-element result vector. |
int |
info
Information about the outcome. |
int[] |
ipvt
The N-element permutation vector for fjac. |
int |
M
The number of functions. |
int |
N
The number of arguments for each function. |
int |
nprint
Debug printout flag. |
double |
tol
Tolerance. |
double[] |
x
The N-element x vector for the least squares problem. |
Constructor Summary | |
---|---|
NonLinearLeastSquares(VectorFunction theFunction)
Construct a new nonlinear least squares problem for the given functions. |
Method Summary | |
---|---|
void |
solve()
Solve this nonlinear least squares minimization problem. |
protected void |
subclassDebug(int iter)
Print debugging information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final VectorFunction fcn
public final int M
public final int N
public final double[] x
public final double[] fvec
public final double[][] fjac
where P is a permutation matrix and J is the final calculated Jacobian. Column j of P is column ipvt[j] (see below) of the identity matrix. The lower trapezoidal part of fjac contains information generated during the computation of R.
fjac is used to calculate the covariance matrix of the solution. This calculation is not yet implemented.
public final int[] ipvt
public double tol
public int info
public int nprint
Constructor Detail |
---|
public NonLinearLeastSquares(VectorFunction theFunction)
theFunction
- Nonlinear functions to be minimized.
NullPointerException
- (unchecked exception) Thrown if theFunction is null.
IllegalArgumentException
- (unchecked exception) Thrown if M <= 0, N <= 0,
or M < N.Method Detail |
---|
public void solve()
IllegalArgumentException
- (unchecked exception) Thrown if tol <= 0.
TooManyIterationsException
- (unchecked exception) Thrown if too many iterations occurred without
finding a minimum (100(N+1) iterations).protected void subclassDebug(int iter)
The default implementation of the subclassDebug() method does nothing. A subclass can override the subclassDebug() method to do something, such as print debugging information.
iter
- Iteration number.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |