#include <leastsquare.h>
Public Methods | |
NonLinearLeastSquare (double accuracy=1e-4, int maxiter=100) | |
Default constructor. | |
NonLinearLeastSquare (double accuracy, int maxiter, QuantLib::Handle< OptimizationMethod< V > > om) | |
Default constructor. | |
~NonLinearLeastSquare () | |
Destructor. | |
template<class M> V & | Perform (LeastSquareProblem< V, M > &lsProblem) |
Solve least square problem using numerix solver. | |
V & | results () |
return the results. | |
double | residualNorm () |
return the least square residual norm. | |
double | lastValue () |
return last function value. | |
int | exitFlag () |
return exit flag. | |
int | iterationsNumber () |
return the performed number of iterations. | |
Private Attributes | |
V | results_ |
solution vector. | |
V | initialValue_ |
solution vector. | |
double | resnorm_ |
least square residual norm. | |
int | exitFlag_ |
Exit flag of the optimization process. | |
double | accuracy_ |
required accuracy of the solver. | |
double | bestAccuracy_ |
required accuracy of the solver. | |
unsigned int | maxIterations_ |
maximum and real number of iterations. | |
unsigned int | nbIterations_ |
maximum and real number of iterations. | |
QuantLib::Handle< OptimizationMethod< V > > | om_ |
Optimization method. |
min { r(x) : x in R^n }
where r(x) = ||f(x)||^2 the euclidian norm of f(x) for some vector-valued function f from R^n to R^m f = (f1, ..., fm) with fi(x) = bi - phi(x,ti) where bi is the vector of target data and phi is a scalar function.
Assuming the differentiability of f, the gradient of r is define by grad r(x) = f'(x)^t.f(x)
V vector class has the requirement of the previous class Handle class is need to manage pointer to optimization method
Definition at line 138 of file leastsquare.h.