QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.41
Loading...
Searching...
No Matches
LevenbergMarquardt Class Reference

Levenberg-Marquardt optimization method. More...

#include <ql/math/optimization/levenbergmarquardt.hpp>

Inheritance diagram for LevenbergMarquardt:

Public Member Functions

 LevenbergMarquardt (Real epsfcn=1.0e-8, Real xtol=1.0e-8, Real gtol=1.0e-8, bool useCostFunctionsJacobian=false)
EndCriteria::Type minimize (Problem &P, const EndCriteria &endCriteria) override
 minimize the optimization problem P
void fcn (int m, int n, Real *x, Real *fvec, int *)
void jacFcn (int m, int n, Real *x, Real *fjac, int *)

Detailed Description

Levenberg-Marquardt optimization method.

This implementation is based on MINPACK (http://www.netlib.org/minpack, http://www.netlib.org/cephes/linalg.tgz) It has a built in fd scheme to compute the jacobian, which is used by default. If useCostFunctionsJacobian is true the corresponding method in the cost function of the problem is used instead. Note that the default implementation of the jacobian in CostFunction uses a central difference (order 2, but requiring more function evaluations) compared to the forward difference implemented here (order 1).

Examples
BermudanSwaption.cpp, and Gaussian1dModels.cpp.

Member Function Documentation

◆ minimize()

EndCriteria::Type minimize ( Problem & P,
const EndCriteria & endCriteria )
overridevirtual

minimize the optimization problem P

Implements OptimizationMethod.

◆ fcn()

void fcn ( int m,
int n,
Real * x,
Real * fvec,
int *  )
Deprecated
Don't use this method; it is for internal use. Deprecated in version 1.37.

◆ jacFcn()

void jacFcn ( int m,
int n,
Real * x,
Real * fjac,
int *  )
Deprecated
Don't use this method; it is for internal use. Deprecated in version 1.37.