Gadget
Public Member Functions | List of all members
OptInfoBFGS Class Reference

This is the class used for the BFGS optimisation. More...

#include <optinfo.h>

Inheritance diagram for OptInfoBFGS:
Inheritance graph
Collaboration diagram for OptInfoBFGS:
Collaboration graph

Public Member Functions

 OptInfoBFGS ()
 This is the default OptInfoBFGS constructor. More...
 
virtual ~OptInfoBFGS ()
 This is the default OptInfoBFGS destructor. More...
 
virtual void read (CommentStream &infile, char *text)
 This is the function used to read in the BFGS parameters. More...
 
virtual void Print (ofstream &outfile, int prec)
 This function will print information from the optimisation algorithm. More...
 
virtual void OptimiseLikelihood ()
 This is the function that will calculate the likelihood score using the BFGS optimiser. More...
 
- Public Member Functions inherited from OptInfo
 OptInfo ()
 This is the default OptInfo constructor. More...
 
virtual ~OptInfo ()
 This is the default OptInfo destructor. More...
 
OptType getType () const
 This will return the type of optimisation class. More...
 

Additional Inherited Members

- Protected Attributes inherited from OptInfo
int converge
 This is the flag used to denote whether the optimisation converged or not. More...
 
int iters
 This is the number of iterations that took place during the optimisation. More...
 
double score
 This is the value of the best likelihood score from the optimisation. More...
 
OptType type
 This denotes what type of optimisation class has been created. More...
 

Detailed Description

This is the class used for the BFGS optimisation.

BFGS is a quasi-Newton global optimisation method that uses information about the gradient of the function at the current point to calculate the best direction to look in to find a better point. Using this information, the BFGS algorithm can iteratively calculate a better approximation to the inverse Hessian matrix, which will lead to a better approximation of the minimum value. From an initial starting point, the gradient of the function is calculated and then the algorithm uses this information to calculate the best direction to perform a linesearch for a point that is ''sufficiently better''. The linesearch that is used in Gadget to look for a better point in this direction is the ''Armijo'' linesearch. The algorithm will then adjust the current estimate of the inverse Hessian matrix, and restart from this new point. If a better point cannot be found, then the inverse Hessian matrix is reset and the algorithm restarts from the last accepted point.

The BFGS algorithm used in Gadget is derived from that presented by Dimitri P Bertsekas, ''Nonlinear Programming'' (2nd edition, pp22-61) published by Athena Scientific.

Constructor & Destructor Documentation

◆ OptInfoBFGS()

OptInfoBFGS::OptInfoBFGS ( )

This is the default OptInfoBFGS constructor.

◆ ~OptInfoBFGS()

virtual OptInfoBFGS::~OptInfoBFGS ( )
inlinevirtual

This is the default OptInfoBFGS destructor.

Member Function Documentation

◆ OptimiseLikelihood()

void OptInfoBFGS::OptimiseLikelihood ( )
virtual

This is the function that will calculate the likelihood score using the BFGS optimiser.

Reimplemented from OptInfo.

◆ Print()

void OptInfoBFGS::Print ( ofstream &  outfile,
int  prec 
)
virtual

This function will print information from the optimisation algorithm.

Parameters
outfileis the ofstream that the optimisation information gets sent to
precis the precision to use in the output file

Reimplemented from OptInfo.

◆ read()

void OptInfoBFGS::read ( CommentStream infile,
char *  text 
)
virtual

This is the function used to read in the BFGS parameters.

Parameters
infileis the CommentStream to read the optimisation parameters from
textis a text string used to compare parameter names

Reimplemented from OptInfo.


The documentation for this class was generated from the following files: