QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
Levenberg-Marquardt optimization method. More...
#include <levenbergmarquardt.hpp>
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 More... | |
virtual Integer | getInfo () const |
void | fcn (int m, int n, Real *x, Real *fvec, int *) |
void | jacFcn (int m, int n, Real *x, Real *fjac, int *) |
![]() | |
virtual | ~OptimizationMethod ()=default |
virtual EndCriteria::Type | minimize (Problem &P, const EndCriteria &endCriteria)=0 |
minimize the optimization problem P More... | |
Private Member Functions | |
void | fcn (int m, int n, Real *x, Real *fvec) |
void | jacFcn (int m, int n, Real *x, Real *fjac) |
Private Attributes | |
Problem * | currentProblem_ |
Array | initCostValues_ |
Matrix | initJacobian_ |
Integer | info_ = 0 |
const Real | epsfcn_ |
const Real | xtol_ |
const Real | gtol_ |
const bool | useCostFunctionsJacobian_ |
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).
Definition at line 49 of file levenbergmarquardt.hpp.
LevenbergMarquardt | ( | Real | epsfcn = 1.0e-8 , |
Real | xtol = 1.0e-8 , |
||
Real | gtol = 1.0e-8 , |
||
bool | useCostFunctionsJacobian = false |
||
) |
Definition at line 29 of file levenbergmarquardt.cpp.
|
overridevirtual |
minimize the optimization problem P
Implements OptimizationMethod.
Definition at line 36 of file levenbergmarquardt.cpp.
|
virtual |
Definition at line 62 of file levenbergmarquardt.hpp.
Definition at line 68 of file levenbergmarquardt.hpp.
Definition at line 74 of file levenbergmarquardt.hpp.
|
private |
Definition at line 79 of file levenbergmarquardt.hpp.
|
private |
Definition at line 80 of file levenbergmarquardt.hpp.
|
private |
Definition at line 81 of file levenbergmarquardt.hpp.
|
mutableprivate |
Definition at line 82 of file levenbergmarquardt.hpp.
|
private |
Definition at line 83 of file levenbergmarquardt.hpp.
|
private |
Definition at line 83 of file levenbergmarquardt.hpp.
|
private |
Definition at line 83 of file levenbergmarquardt.hpp.
|
private |
Definition at line 84 of file levenbergmarquardt.hpp.