Jpp
|
Fit method based on the Levenberg-Marquardt method. More...
#include <JGandalf.hh>
Classes | |
struct | result_type |
Data structure for return value of fit function. More... | |
Public Types | |
typedef JModel_t::parameter_type | parameter_type |
Data type of fit parameter. More... | |
Public Member Functions | |
JGandalf () | |
Default constructor. More... | |
template<class JFunction_t , class T , class... Args> | |
result_type | operator() (const JFunction_t &fit, T __begin, T __end, Args...args) |
Multi-dimensional fit of two data sets. More... | |
Public Attributes | |
double | lambda |
JModel_t | value |
JModel_t | error |
std::vector< parameter_type > | parameters |
int | numberOfIterations |
JMATH::JMatrixNS | H |
Static Public Attributes | |
static int | MAXIMUM_ITERATIONS = 1000 |
maximal number of iterations More... | |
static double | EPSILON = 1.0e-3 |
maximal distance to minimum More... | |
static double | LAMBDA_MIN = 0.01 |
minimal value control parameter More... | |
static double | LAMBDA_MAX = 100.0 |
maximal value control parameter More... | |
static double | LAMBDA_UP = 9.0 |
multiplication factor control parameter More... | |
static double | LAMBDA_DOWN = 11.0 |
multiplication factor control parameter More... | |
static double | PIVOT = 1.0e-3 |
minimal value diagonal element of matrix More... | |
static int | debug = 0 |
debug level (default is off). More... | |
Private Member Functions | |
void | reset () |
Reset. More... | |
template<class JFunction_t , class T , class... Args> | |
void | __evaluate__ (const JFunction_t &fit, T __begin, T __end, Args...args) |
Recursive method for evaluation of fit. More... | |
template<class JFunction_t > | |
void | __evaluate__ (const JFunction_t &fit) |
Termination method for evaluation of fit. More... | |
Static Private Member Functions | |
template<class T > | |
static double | alias (const T &model, const typename T::parameter_type parameter) |
Read/write access to parameter value by data member. More... | |
template<class T > | |
static double & | alias (T &model, const typename T::parameter_type parameter) |
Read/write access to parameter value by data member. More... | |
template<class T > | |
static double | alias (const T &model, const size_t index) |
Read/write access to parameter value by index. More... | |
template<class T > | |
static double & | alias (T &model, const size_t index) |
Read/write access to parameter value by index. More... | |
template<class T > | |
static double | alias (const T &model, const int index) |
Read/write access to parameter value by index. More... | |
template<class T > | |
static double & | alias (T &model, const int index) |
Read/write access to parameter value by index. More... | |
Private Attributes | |
result_type | successor |
JModel_t | previous |
std::vector< double > | h |
Fit method based on the Levenberg-Marquardt method.
The template argument refers to the model that should be fitted to the data.
This data structure should have arithmetic capabilities.
The data member JGandalf::value corresponds to the start c.q. final value of the model of the fit procedure and JGandalf::error to the uncertainties.
The co-variance matrix is stored in data member JGandalf::H.
The data member JGandalf::parameters constitutes a list of those parameters of the model that should actually be fitted.
For this, the model should contain the type definition for parameter_type
.
Normally, this type definition corresponds to a pointer to a data member of the model.
Alternatively, the type definition can be size_t
or int
.
In that case, the model class should provide for the element access operator[]
.
The template fit function in JGandalf::operator() should provide for an implementation of the function.
This operator should return the data type JGandalf::result_type which is composed of the value of the chi2 and the gradient of a data point, respectively.
The function operator returns the chi2 of the overall fit.
Definition at line 52 of file JGandalf.hh.
typedef JModel_t::parameter_type JFIT::JGandalf< JModel_t >::parameter_type |
Data type of fit parameter.
Definition at line 63 of file JGandalf.hh.
|
inline |
|
inline |
Multi-dimensional fit of two data sets.
The fit function should return the equivalent of chi2 for the current value of the model and the given data point as well as the partial derivatives.
fit | fit function |
__begin | begin of data |
__end | end of data |
Definition at line 127 of file JGandalf.hh.
|
inlineprivate |
Reset.
Definition at line 266 of file JGandalf.hh.
|
inlineprivate |
Recursive method for evaluation of fit.
fit | fit function |
__begin | begin of data |
__end | end of data |
Definition at line 286 of file JGandalf.hh.
|
inlineprivate |
Termination method for evaluation of fit.
fit | fit function |
Definition at line 314 of file JGandalf.hh.
|
inlinestaticprivate |
Read/write access to parameter value by data member.
model | model |
parameter | parameter |
Definition at line 326 of file JGandalf.hh.
|
inlinestaticprivate |
Read/write access to parameter value by data member.
model | model |
parameter | parameter |
Definition at line 340 of file JGandalf.hh.
|
inlinestaticprivate |
Read/write access to parameter value by index.
model | model |
index | index |
Definition at line 354 of file JGandalf.hh.
|
inlinestaticprivate |
Read/write access to parameter value by index.
model | model |
index | index |
Definition at line 368 of file JGandalf.hh.
|
inlinestaticprivate |
Read/write access to parameter value by index.
model | model |
index | index |
Definition at line 382 of file JGandalf.hh.
|
inlinestaticprivate |
Read/write access to parameter value by index.
model | model |
index | index |
Definition at line 396 of file JGandalf.hh.
|
static |
maximal number of iterations
maximal number of iterations.
Definition at line 247 of file JGandalf.hh.
|
static |
maximal distance to minimum
maximal distance to minimum.
Definition at line 248 of file JGandalf.hh.
|
static |
minimal value control parameter
Definition at line 249 of file JGandalf.hh.
|
static |
maximal value control parameter
Definition at line 250 of file JGandalf.hh.
|
static |
multiplication factor control parameter
Definition at line 251 of file JGandalf.hh.
|
static |
multiplication factor control parameter
Definition at line 252 of file JGandalf.hh.
|
static |
minimal value diagonal element of matrix
Definition at line 253 of file JGandalf.hh.
double JFIT::JGandalf< JModel_t >::lambda |
Definition at line 255 of file JGandalf.hh.
JModel_t JFIT::JGandalf< JModel_t >::value |
Definition at line 256 of file JGandalf.hh.
JModel_t JFIT::JGandalf< JModel_t >::error |
Definition at line 257 of file JGandalf.hh.
std::vector<parameter_type> JFIT::JGandalf< JModel_t >::parameters |
Definition at line 258 of file JGandalf.hh.
int JFIT::JGandalf< JModel_t >::numberOfIterations |
Definition at line 259 of file JGandalf.hh.
JMATH::JMatrixNS JFIT::JGandalf< JModel_t >::H |
Definition at line 260 of file JGandalf.hh.
|
private |
Definition at line 402 of file JGandalf.hh.
|
private |
Definition at line 403 of file JGandalf.hh.
|
private |
Definition at line 404 of file JGandalf.hh.
|
staticinherited |
debug level (default is off).
Definition at line 45 of file JMessage.hh.