template<class func_t = gen_fit_funct<>, class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>>
class o2scl::fit_min< func_t, vec_t, mat_t >
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
Definition at line 61 of file fit_min.h.
|
virtual 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 in par . More...
|
|
int | set_mmin (mmin_base< multi_funct > &mm) |
| Set the mmin object to use (default is of type o2scl::mmin_simp2) More...
|
|
virtual const char * | type () |
| Return string denoting type ("fit_min")
|
|
virtual int | print_iter (size_t nv, boost::numeric::ublas::vector< double > &x, double y, int iter, double value=0.0, double limit=0.0) |
| Print out iteration information. More...
|
|
virtual int | fit (size_t npar, boost::numeric::ublas::vector< double > &parms, boost::numeric::ublas::matrix< double > &covar, double &chi2, gen_fit_funct<> &fitfun)=0 |
| Fit function fitfun using parameters in parms as initial guesses. More...
|
|
int | test_delta_f (size_t nparm, boost::numeric::ublas::vector< double > &dx, boost::numeric::ublas::vector< double > &x, double l_epsabs, double l_epsrel) |
| Test if converged.
|
|
int | test_gradient_f (size_t nparm, boost::numeric::ublas::vector< double > &g, double l_epsabs) |
| Test if converged.
|
|
|
double | min_func (size_t np, const vec_t &xp) |
| The function to minimize, .
|
|
double | compute_actual_reduction (double fnorm0, double fnorm1) |
| Desc.
|
|
size_t | count_nsing (const size_t ncols, const boost::numeric::ublas::matrix< double > &r2) |
| Desc.
|
|
void | compute_newton_direction (size_t n, const boost::numeric::ublas::matrix< double > &r2, const permutation &perm2, const boost::numeric::ublas::vector< double > &qtf2, boost::numeric::ublas::vector< double > &x) |
| Desc.
|
|
void | compute_newton_bound (size_t nd, size_t np, const boost::numeric::ublas::matrix< double > &r2, const boost::numeric::ublas::vector< double > &x, double dxnorm, const permutation &perm, const boost::numeric::ublas::vector< double > &diag, boost::numeric::ublas::vector< double > &w) |
| Desc.
|
|
void | compute_gradient_direction (size_t n, const boost::numeric::ublas::matrix< double > &r, const permutation &p, const boost::numeric::ublas::vector< double > &qtf2, const boost::numeric::ublas::vector< double > &diag, boost::numeric::ublas::vector< double > &g) |
| Desc.
|
|
void | update_diag (size_t n, const boost::numeric::ublas::matrix< double > &J, boost::numeric::ublas::vector< double > &diag2) |
| Desc.
|
|
double | scaled_enorm (const boost::numeric::ublas::vector< double > &d, size_t n, const boost::numeric::ublas::vector< double > &f) |
| Euclidean norm of vector f of length n , scaled by vector d .
|
|
double | compute_delta (boost::numeric::ublas::vector< double > &diag2, size_t n, const boost::numeric::ublas::vector< double > &x) |
| Desc.
|
|
void | compute_rptdx (const boost::numeric::ublas::matrix< double > &r2, const permutation &p, size_t N, boost::numeric::ublas::vector< double > &dx, boost::numeric::ublas::vector< double > &rptdx2) |
| Desc.
|
|
int | qrsolv (size_t n, boost::numeric::ublas::matrix< double > &r2, const permutation &p, const double lambda, const boost::numeric::ublas::vector< double > &diag2, const boost::numeric::ublas::vector< double > &qtb, boost::numeric::ublas::vector< double > &x, boost::numeric::ublas::vector< double > &sdiag2, boost::numeric::ublas::vector< double > &wa) |
| Compute the solution to a least squares system. More...
|
|
void | compute_newton_correction (size_t n, const boost::numeric::ublas::matrix< double > &r2, const boost::numeric::ublas::vector< double > &sdiag2, const permutation &p, boost::numeric::ublas::vector< double > &x, double dxnorm, const boost::numeric::ublas::vector< double > &diag2, boost::numeric::ublas::vector< double > &w2) |
| Desc.
|
|
void | lmpar (boost::numeric::ublas::matrix< double > &r2, const permutation &perm2, const boost::numeric::ublas::vector< double > &qtf2, const boost::numeric::ublas::vector< double > &diag2, double delta2, double *par_inout, boost::numeric::ublas::vector< double > &newton2, boost::numeric::ublas::vector< double > &gradient2, boost::numeric::ublas::vector< double > &sdiag2, boost::numeric::ublas::vector< double > &x, boost::numeric::ublas::vector< double > &w2, size_t nparm, size_t ndata) |
| Determine Levenburg-Marquardt parameter.
|
|
void | compute_trial_step (size_t N, boost::numeric::ublas::vector< double > &x, boost::numeric::ublas::vector< double > &dx, boost::numeric::ublas::vector< double > &trial) |
| Compute trial step, .
|
|
int | compute_diag (size_t nparm, size_t ndata, const boost::numeric::ublas::matrix< double > &J, boost::numeric::ublas::vector< double > &diag_vec) |
| Compute the root of the sum of the squares of the columns of J . More...
|
|
int | covariance (size_t m, size_t n, const boost::numeric::ublas::matrix< double > &J, boost::numeric::ublas::matrix< double > &covar, boost::numeric::ublas::vector< double > &norm, boost::numeric::ublas::matrix< double > &r, boost::numeric::ublas::vector< double > &tau, permutation &perm, double epsrel) |
| Compute the covarance matrix covar given the Jacobian J . More...
|
|