#include <Optimizer.h>
Inheritance diagram for BFGS:
Modification: the BFGS algorithm uses a Newton step of a length designed to hit the minimum quickly if the function is a parabola. This implementation always takes a time step of length maxstep
in the current direction and then performs a line search backward toward the last point. Why do we do that? The functions we are trying to minimize are of the form
where X(u) is a random variable depending on the parameter vector u and E denotes the expectation as usual.
The function f(u) may very well be smooth but unfortunately we cannot work with the true expectation but instead have to work with the Monte Carlo computed sample mean
where the are independent observations of . This function will most likely not be smooth as a function of the parameter vector u. Instead the parameter u will have to move at least for a minimal threshhold value before the finite sample of recognizes a difference. We should therefore think of as blocky, instead of a smooth parabola we will have a sequence of concentric flat terraces descending toward the minimum.
Obviously we have to choose a step size which gets us off each terrace. Likewise we have to compute the function gradients with variable increments of sufficient size lest we find ourselves with a zero gradient despite being far from the local minimum.
Definition at line 287 of file Optimizer.h.
Public Member Functions | |
int | getDimension () const |
const RealArray1D & | getGrad () const |
const RealArray1D & | getX () const |
const RealArray1D & | getD () const |
BFGS (const RealArray1D &u, int vals, Real maxstep, const RealArray1D &k, int resets=2, bool vbose=false) | |
void | setInitialConditions () |
const RealArray1D & | search () |
Protected Attributes | |
Real | stepmax |
int | nVals |
int | fVals |
int | restarts |
int | nRestarts |
RealArray1D | x0 |
RealArray1D | grad0 |
RealArray1D | x |
RealArray1D | xDelta |
RealArray1D | grad |
RealArray1D | z |
RealArray1D | d |
RealArray1D | gDelta |
RealArray1D | hdg |
RealArray1D | u |
RealArray1D | h |
Real | fx0 |
Real | fx |
RealArray2D | H |
bool | verbose |
Static Protected Attributes | |
Real | EPSX |
Real | KF |
Real | EPSG |
Real | EPS |
|
|
|
Dimension of the search space. Definition at line 339 of file Optimizer.h. References Optimizer::n. |
|
Current gradient. Definition at line 342 of file Optimizer.h. |
|
Current point. Definition at line 345 of file Optimizer.h. |
|
Current direction. Definition at line 348 of file Optimizer.h. |
|
Sets function value, gradient and initial direction by making calls to Optimizer#f. We do this at the start of the search since we can't call a virtual member frunction in the constructor. Referenced by ConcreteBFGS::ConcreteBFGS(). |
|
Unconstrained search for the minimum of the function Optimizer#f. Vector is owned by this. Do not delete.
Implements Optimizer. |
|
Termination in line search if t falls below this threshold. Definition at line 294 of file Optimizer.h. |
|
Proportional decrease in function value enforced at each step in line search. Definition at line 294 of file Optimizer.h. |
|
Termination if norm of gradient falls below this threshold. Definition at line 294 of file Optimizer.h. |
|
Small number to correct division by zero. Definition at line 294 of file Optimizer.h. |
|
Definition at line 303 of file Optimizer.h. Referenced by ConcreteBFGS::ConcreteBFGS(). |
|
Definition at line 304 of file Optimizer.h. Referenced by ConcreteBFGS::ConcreteBFGS(). |
|
Definition at line 304 of file Optimizer.h. |
|
Definition at line 304 of file Optimizer.h. |
|
Definition at line 304 of file Optimizer.h. Referenced by ConcreteBFGS::ConcreteBFGS(). |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. Referenced by ConcreteBFGS::ConcreteBFGS(). |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. |
|
Definition at line 312 of file Optimizer.h. Referenced by ConcreteBFGS::ConcreteBFGS(). |
|
Definition at line 324 of file Optimizer.h. |
|
Definition at line 324 of file Optimizer.h. |
|
Definition at line 328 of file Optimizer.h. |
|
Definition at line 331 of file Optimizer.h. Referenced by ConcreteBFGS::ConcreteBFGS(). |