Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

BFGS Class Reference

#include <Optimizer.h>

Inheritance diagram for BFGS:

Optimizer ConcreteBFGS List of all members.

Detailed Description

BFGS minimizer for multivariate functions as described in NR and with some modifications to cope with the lack of smoothness of the objective function. Code clarity is preferred to efficiency. The code in NR is more compact and consequently more efficient. Here the view is taken that the bulk of the computational effort is spent on evaluations of the function to be minimized.

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.

Author:
Michael J. Meyer

Definition at line 287 of file Optimizer.h.

Public Member Functions

int getDimension () const
const RealArray1DgetGrad () const
const RealArray1DgetX () const
const RealArray1DgetD () const
 BFGS (const RealArray1D &u, int vals, Real maxstep, const RealArray1D &k, int resets=2, bool vbose=false)
void setInitialConditions ()
const RealArray1Dsearch ()

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


Constructor & Destructor Documentation

BFGS::BFGS const RealArray1D   u,
int    vals,
Real    maxstep,
const RealArray1D   k,
int    resets = 2,
bool    vbose = false
 

Parameters:
u starting point of min search
vals maximum number of function evaluations allowed
maxstep maximum step length in line search
k variable increments dx_j in the gradient computation.
resets number of times the optimizer is restarted.
vbose messages about results, default is false</code.


Member Function Documentation

int BFGS::getDimension   const [inline]
 

Dimension of the search space.

Definition at line 339 of file Optimizer.h.

References Optimizer::n.

const RealArray1D& BFGS::getGrad   const [inline]
 

Current gradient.

Definition at line 342 of file Optimizer.h.

const RealArray1D& BFGS::getX   const [inline]
 

Current point.

Definition at line 345 of file Optimizer.h.

const RealArray1D& BFGS::getD   const [inline]
 

Current direction.

Definition at line 348 of file Optimizer.h.

void BFGS::setInitialConditions  
 

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().

const RealArray1D& BFGS::search   [virtual]
 

Unconstrained search for the minimum of the function Optimizer#f. Vector is owned by this. Do not delete.

Returns:
the minimizing vector x.

Implements Optimizer.


Member Data Documentation

Real BFGS::EPSX [static, protected]
 

Termination in line search if t falls below this threshold.

Definition at line 294 of file Optimizer.h.

Real BFGS::KF [static, protected]
 

Proportional decrease in function value enforced at each step in line search.

Definition at line 294 of file Optimizer.h.

Real BFGS::EPSG [static, protected]
 

Termination if norm of gradient falls below this threshold.

Definition at line 294 of file Optimizer.h.

Real BFGS::EPS [static, protected]
 

Small number to correct division by zero.

Definition at line 294 of file Optimizer.h.

Real BFGS::stepmax [protected]
 

Definition at line 303 of file Optimizer.h.

Referenced by ConcreteBFGS::ConcreteBFGS().

int BFGS::nVals [protected]
 

Definition at line 304 of file Optimizer.h.

Referenced by ConcreteBFGS::ConcreteBFGS().

int BFGS::fVals [protected]
 

Definition at line 304 of file Optimizer.h.

int BFGS::restarts [protected]
 

Definition at line 304 of file Optimizer.h.

int BFGS::nRestarts [protected]
 

Definition at line 304 of file Optimizer.h.

Referenced by ConcreteBFGS::ConcreteBFGS().

RealArray1D BFGS::x0 [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::grad0 [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::x [protected]
 

Definition at line 312 of file Optimizer.h.

Referenced by ConcreteBFGS::ConcreteBFGS().

RealArray1D BFGS::xDelta [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::grad [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::z [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::d [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::gDelta [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::hdg [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::u [protected]
 

Definition at line 312 of file Optimizer.h.

RealArray1D BFGS::h [protected]
 

Definition at line 312 of file Optimizer.h.

Referenced by ConcreteBFGS::ConcreteBFGS().

Real BFGS::fx0 [protected]
 

Definition at line 324 of file Optimizer.h.

Real BFGS::fx [protected]
 

Definition at line 324 of file Optimizer.h.

RealArray2D BFGS::H [protected]
 

Definition at line 328 of file Optimizer.h.

bool BFGS::verbose [protected]
 

Definition at line 331 of file Optimizer.h.

Referenced by ConcreteBFGS::ConcreteBFGS().


The documentation for this class was generated from the following file:
Generated on Mon Sep 22 02:16:32 2003 for Libor-Library by doxygen1.3-rc3