Class fit_min (o2scl)¶
-
template<class
func_t
= gen_fit_funct<>, classvec_t
= boost::numeric::ublas::vector<double>, classmat_t
= boost::numeric::ublas::matrix<double>>
classo2scl
::
fit_min
: public o2scl::fit_base<gen_fit_funct<>, boost::numeric::ublas::vector<double>, boost::numeric::ublas::matrix<double>>, public o2scl::fit_nonlin_b<boost::numeric::ublas::vector<double>, boost::numeric::ublas::matrix<double>>¶ Non-linear least-squares fitting class with generic minimizer.
This minimizes a generic fitting function using any o2scl::mmin_base 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 o2scl::fit_nonlin. For problems with many local minima near the global minimum, using a o2scl::anneal_base object with this class can sometimes produce better results than o2scl::fit_nonlin.
Default template arguments
func_t
- gen_fit_funct<>vec_t
- boost::numeric::ublas::vector <double >mat_t
- boost::numeric::ublas::matrix <double >
Public Functions
-
fit_min
()¶
-
~fit_min
()¶
-
int
fit
(size_t npar, vec_t &par, mat_t &covar, double &chi2, func_t &fitfun)¶ Fit the data specified in (xdat,ydat) to the function
fitfun
with the parameters inpar
.The covariance matrix for the parameters is returned in
covar
and the value of \( \chi^2 \) is returned inchi2
.
-
int
set_mmin
(mmin_base<multi_funct> &mm)¶ Set the mmin object to use (default is of type o2scl::mmin_simp2)
-
const char *
type
()¶ Return string denoting type (“fit_min”)
Public Members
-
mmin_simp2<multi_funct>
def_mmin
¶ The default minimizer.
Protected Functions