|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.omegahat.Numerics.Optimizers.OptimizerAlgorithmBasic
|
+--org.omegahat.Numerics.Optimizers.OptimizerAlgorithmBFGS
The BFGS method for unconstrained optimization.
This is a quasi-newton method, requiring a model with derivates. It proceeds by developing an approximation to the inverse hessian matrix at the optimum, doing approximate one-dimensional optimizations at each search direction. This matrix, called H below and in most literature, is the key ingredient in this (and other) quasi-newton methods.
The key numerical properties of BFGS are: superlinear convergence for a wide mathematical range of functions provided accurate gradients are available; moderate accuracy in the final H estimate. A true newton method may be better if second derivatives are available and not too expensive, but only if the function is convex or not too far off and the method is made robust. Some other quasi-newton (symmetric rank-1, e.g.) may do a better job of estimating H at the optimum.
| Field Summary | |
protected boolean |
debug
|
protected double |
gradientTol
The tolerance for convergence, in terms of the norm of the gradient. |
protected NumericMatrix |
H
The estimate of the information (inverse second derivative) matrix. |
protected LineSearch |
search
The object defining the line search strategy for this optimizer algorithm. |
protected LineStep |
step
|
protected double |
stepSize
The default step size for the linear search. |
| Fields inherited from class org.omegahat.Numerics.Optimizers.OptimizerAlgorithmBasic |
arrayClass, arrayTemplate, gradient, hessian, matrixClass, matrixPackage, matrixTemplate, model, modelPointClass, modelPointTemplate, start, state |
| Constructor Summary | |
OptimizerAlgorithmBFGS()
|
|
| Method Summary | |
boolean |
getDebug()
Accessor for debug field |
double |
getGradientTol()
Accessor for gradientTol field |
NumericMatrix |
getH()
Accessor for H field |
LineSearch |
getSearch()
Accessor for search field |
LineStep |
getStep()
Accessor for step field |
double |
getStepSize()
Accessor for stepSize field |
ModelPoint |
initialize(double[] parameters,
OptimizerIterator opt)
Initialize the model with the specified starting parameter estimates and iterator. |
ModelPoint |
refine(ModelPoint theta,
OptimizerIterator opt)
The refine method for the BFGS quasi-Newton algorithm. |
boolean |
setDebug(boolean value)
Accessor for setting debug field |
double |
setGradientTol(double value)
Accessor for setting gradientTol field |
NumericMatrix |
setH(NumericMatrix value)
Accessor for setting H field |
LineSearch |
setSearch(LineSearch value)
Accessor for setting search field |
LineStep |
setStep(LineStep value)
Accessor for setting step field |
double |
setStepSize(double value)
Accessor for setting stepSize field |
void |
updateH(ModelPointNumericInt prev,
LineStep current)
|
| Methods inherited from class org.omegahat.Numerics.Optimizers.OptimizerAlgorithmBasic |
getArrayClass, getArrayTemplate, getMatrixClass, getMatrixPackage, getMatrixTemplate, getModel, getModelPointClass, getModelPointTemplate, getStart, getState, hasGradient, hasHessian, initialize, newArray, newMatrix, newModelPoint, setArrayClass, setArrayTemplate, setGradient, setHessian, setMatrixClass, setMatrixPackage, setMatrixPackage, setMatrixPackage, setMatrixTemplate, setModel, setModelPointClass, setModelPointTemplate, setStart, setStart, setState, wrapup |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected double stepSize
The BFGS algorithm defines this as 1.0, based on the theory that
the algorithm tends to a Newton step, which in turn eventually succeeds with
a quadratic approximation and unit step size.
To override this initially, set the stepSize property
after the initialize method of this object has
been called.
To override the step size dynamically during iteration, add a listener to the optimizer
and have the listener set the stepSize property,
via opt.getAlgorithm().setStepSize(step).
protected NumericMatrix H
An initial estimate of this matrix is recommended; if nothing else, an estimate by a diagonal matrix of rough estimates of the expected variances of the parameters might help. The default is an identity matrix.
protected LineSearch search
protected LineStep step
protected double gradientTol
Its default value is 1e-7. Only values > 0. are allowed, of course, and numbers down around the double-precision relative accuracy (say, < 1e-15) are unlikely to be achieved for most computations.
protected boolean debug
| Constructor Detail |
public OptimizerAlgorithmBFGS()
| Method Detail |
public NumericMatrix getH()
H fieldpublic NumericMatrix setH(NumericMatrix value)
H fieldpublic LineSearch getSearch()
search fieldpublic LineSearch setSearch(LineSearch value)
search fieldpublic LineStep getStep()
step fieldpublic LineStep setStep(LineStep value)
step fieldpublic double getStepSize()
stepSize fieldpublic double setStepSize(double value)
stepSize fieldpublic double getGradientTol()
gradientTol fieldpublic double setGradientTol(double value)
gradientTol fieldpublic boolean getDebug()
debug fieldpublic boolean setDebug(boolean value)
debug field
public ModelPoint initialize(double[] parameters,
OptimizerIterator opt)
H matrix, if not already set up of the
correct dimensions, and the step. Sets the H matrix to the identity.
The default step has an initial step size of 1.initialize in class OptimizerAlgorithmBasic
public ModelPoint refine(ModelPoint theta,
OptimizerIterator opt)
The method is to carry out a line search at the current point, in the direction - H . g, where g is the gradient of the current point. The default line search is from the LineSearchWolfe class. When the line search completes, the matrix H is updated by the updateH method.
public void updateH(ModelPointNumericInt prev,
LineStep current)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||