|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.math.BoundedLeastSquares
public class BoundedLeastSquares
Solves a nonlinear least-squares problem subject to bounds on the variables using a modified Levenberg-Marquardt algorithm.
Class BoundedLeastSquares
uses a modified
Levenberg-Marquardt method and an active set strategy to solve nonlinear
least-squares problems subject to simple bounds on the variables. The
problem is stated as follows:
subject to
where , , and is the
i-th component function of F(x). From a given starting point,
an active set IA
, which contains the indices of the variables
at their bounds, is built. A variable is called a "free variable" if it is
not in the active set. The routine then computes the search direction for
the free variables according to the formula
where is the Levenberg-Marquardt parameter,
F = F(x), and J is the Jacobian with respect to the free
variables. The search direction for the variables in IA
is set
to zero. The trust region approach discussed by Dennis and Schnabel (1983)
is used to find the new point. Finally, the optimality conditions are
checked. The conditions are:
where is a gradient tolerance. This process is repeated until the optimality criterion is achieved.
The active set is changed only when a free variable hits its bounds
during an iteration or the optimality condition is met for the free
variables but not for all variables in IA
, the active set. In
the latter case, a variable that violates the optimality condition will be
dropped out of IA
. For more details on the Levenberg-Marquardt
method, see Levenberg (1944) or Marquardt (1963). For more detail on the
active set strategy, see Gill and Murray (1976).
Nested Class Summary | |
---|---|
static class |
BoundedLeastSquares.FalseConvergenceException
False convergence - The iterates appear to be converging to a noncritical point. |
static interface |
BoundedLeastSquares.Function
Public interface for the user-supplied function to evaluate the function that defines the least-squares problem. |
static interface |
BoundedLeastSquares.Jacobian
Public interface for the user-supplied function to compute the Jacobian. |
static class |
BoundedLeastSquares.NoProgressException
The algorithm is not making any progress, try new initial guess. |
Constructor Summary | |
---|---|
BoundedLeastSquares(BoundedLeastSquares.Function function,
int mFunctions,
int nVariables,
int boundType,
double[] lowerBound,
double[] upperBound)
Constructor for BoundedLeastSquares . |
Method Summary | |
---|---|
double[][] |
getJacobian()
Returns the Jacobian at the approximate solution. |
double[] |
getResiduals()
Returns the residuals at the approximate solution. |
double[] |
getSolution()
Returns the solution. |
void |
setAbsoluteFcnTol(double absoluteFcnTol)
Sets the absolute function tolerance. |
void |
setDiagonalScalingMatrix(double[] diagonalScalingMatrix)
Sets the diagonal scaling matrix for the functions. |
void |
setGoodDigit(int goodDigit)
Sets the number of good digits in the function. |
void |
setGradientTol(double gradientTol)
Sets the scaled gradient tolerance. |
void |
setGuess(double[] guess)
Sets the initial guess of the solution. |
void |
setInternalScale()
Sets the internal variable scaling option. |
void |
setJacobian(BoundedLeastSquares.Jacobian jacobian)
Sets the Jacobian. |
void |
setMaximumFunctionEvals(int evaluations)
Sets the maximum number of function evaluations. |
void |
setMaximumIteration(int iterations)
Sets the maximum number of iterations. |
void |
setMaximumJacobianEvals(int evaluations)
Sets the maximum number of Jacobian evaluations. |
void |
setMaximumStepSize(double stepSize)
Sets the maximum allowable step size. |
void |
setRelativeFcnTol(double relativeFcnTol)
Sets the relative function tolerance. |
void |
setScaledStepTol(double scaledStepTol)
Sets the scaled step tolerance. |
void |
setScalingVector(double[] scalingVector)
Sets the scaling vector for the variables. |
void |
setTrustRegion(double trustRegion)
Sets the size of initial trust region radius. |
void |
solve()
Solves a nonlinear least-squares problem subject to bounds on the variables using a modified Levenberg-Marquardt algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoundedLeastSquares(BoundedLeastSquares.Function function, int mFunctions, int nVariables, int boundType, double[] lowerBound, double[] upperBound)
BoundedLeastSquares
.
function
- a Function
object, user-supplied
function to evaluate the functionmFunctions
- a int
scalar containing the number of
functionsnVariables
- a int
scalar containing the number of
variablesboundType
- a int
scalar containing the types of
bounds on the variable
boundType | Action |
0 | User will supply all the bounds. |
1 | All variables are nonnegative. |
2 | All variables are nonpositive. |
3 | User supplies only the bounds on first variable, all other variables will have the same bounds. |
lowerBound
- a double
array containing the lower
bounds on the variablesupperBound
- a double
array containing the upper
bounds on the variables
IllegalArgumentException
- is thrown if the dimensions of
mFunctions
, nVariables
,
boundType
, lowerBound.length
and upperBound.length
are not consistentMethod Detail |
---|
public double[][] getJacobian()
mFunctions x nVariables double
matrix containing
the Jacobian at the approximate solutionpublic double[] getResiduals()
double
array containing the residuals at the
approximate solutionpublic double[] getSolution()
double
array containing the computed solutionpublic void setAbsoluteFcnTol(double absoluteFcnTol)
absoluteFcnTol
- a double
scalar containing the
absolute function tolerancepublic void setDiagonalScalingMatrix(double[] diagonalScalingMatrix)
diagonalScalingMatrix
- a double
array containing
the diagonal scaling for the functionspublic void setGoodDigit(int goodDigit)
goodDigit
- a int
scalar containing the number of
good digitspublic void setGradientTol(double gradientTol)
gradientTol
- a double
scalar containing the scaled
gradient tolerancepublic void setGuess(double[] guess)
guess
- a double
array containing an initial guesspublic void setInternalScale()
public void setJacobian(BoundedLeastSquares.Jacobian jacobian)
jacobian
- a Jacobian
object to compute the
Jacobian.public void setMaximumFunctionEvals(int evaluations)
evaluations
- a int
scalar containing the maximum
number of function evaluationspublic void setMaximumIteration(int iterations)
iterations
- a int
scalar containing the maximum
number of iterationspublic void setMaximumJacobianEvals(int evaluations)
evaluations
- a int
scalar containing the maximum
number of Jacobian evaluationspublic void setMaximumStepSize(double stepSize)
stepSize
- a double
scalar containing the maximum
allowable step sizepublic void setRelativeFcnTol(double relativeFcnTol)
relativeFcnTol
- a double
scalar containing the
relative function tolerancepublic void setScaledStepTol(double scaledStepTol)
scaledStepTol
- a double
scalar containing the
scaled step tolerancepublic void setScalingVector(double[] scalingVector)
scalingVector
- a double
array containing the
scaling vector for the variablespublic void setTrustRegion(double trustRegion)
trustRegion
- a double
scalar containing the initial
trust region radiuspublic final void solve() throws BoundedLeastSquares.FalseConvergenceException, BoundedLeastSquares.NoProgressException
BoundedLeastSquares.FalseConvergenceException
- is thrown when the iterates
appear to be converging to a
noncritical point.
BoundedLeastSquares.NoProgressException
- is thrown when the algorithm is not
making any progress. Try a new initial
guess.
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |