#include <min_fit.h>
This minimizes a generic fitting function using any multi_min object, and then uses the GSL routines to calculate the uncertainties in the parameters and the covariance matrix.
This can be useful for fitting problems which might be better handled by more complex minimizers than those that are used in gsl_fit. For problems with many local minima near the global minimum, using a sim_anneal object with this class can sometimes produce better results than gsl_fit.
Definition at line 53 of file min_fit.h.
Public Member Functions | |
min_fit () | |
virtual | ~min_fit () |
virtual int | fit (size_t ndat, vec_t &xdat, vec_t &ydat, vec_t &yerr, size_t npar, vec_t &par, mat_t &covar, double &chi2, param_t &pa, func_t &fitfun) |
Fit the data specified in (xdat,ydat) to the function fitfun with the parameters in par . | |
int | set_multi_min (multi_min< func_par *, multi_funct< func_par *, vec_t > > &mm) |
Set the multi_min object to use (default is gsl_mmin_nmsimplex). | |
virtual const char * | type () |
Return string denoting type ("min_fit"). | |
Data Fields | |
gsl_mmin_simp < func_par *, multi_funct < func_par *, vec_t > > | def_multi_min |
The default minimizer. | |
Protected Member Functions | |
double | min_func (size_t np, const vec_t &xp, func_par *&fp) |
The function to minimize. | |
Static Protected Member Functions | |
static int | func (const gsl_vector *x, void *pa, gsl_vector *f) |
Evaluate the function. | |
static int | dfunc (const gsl_vector *x, void *pa, gsl_matrix *jac) |
Evaluate the jacobian. | |
static int | fdfunc (const gsl_vector *x, void *pa, gsl_vector *f, gsl_matrix *jac) |
Evaluate the function and the jacobian. | |
Protected Attributes | |
multi_min< func_par *, multi_funct < func_par *, vec_t > > * | mmp |
The minimizer. | |
bool | min_set |
True if the minimizer has been set by the user. | |
Data Structures | |
struct | func_par |
A structure for passing information to the GSL functions. More... |
virtual int fit | ( | size_t | ndat, | |
vec_t & | xdat, | |||
vec_t & | ydat, | |||
vec_t & | yerr, | |||
size_t | npar, | |||
vec_t & | par, | |||
mat_t & | covar, | |||
double & | chi2, | |||
param_t & | pa, | |||
func_t & | fitfun | |||
) | [inline, virtual] |
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page