Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
o2scl::chi_fit_funct< vec_t, mat_t, fit_func_t > Class Template Reference

Standard fitting function based on one-dimensional data with a numerical Jacobian. More...

#include <fit_base.h>

Inheritance diagram for o2scl::chi_fit_funct< vec_t, mat_t, fit_func_t >:
o2scl::gen_fit_funct< vec_t, mat_t >

Public Member Functions

 chi_fit_funct (size_t ndat, const vec_t &xdat, const vec_t &ydat, const vec_t &yerr, fit_func_t &fun)
 Create an object with specified data and specified fitting function.
 
void set_data (size_t ndat, const vec_t &xdat, const vec_t &ydat, const vec_t &yerr)
 Set the data to be fit.
 
void set_func (fit_func_t &fun)
 Set the fitting function.
 
virtual double chi2 (size_t np, const vec_t &p)
 Return $ \chi^2 $.
 
virtual void operator() (size_t np, const vec_t &p, size_t nd, vec_t &f)
 Using parameters in p, compute the relative deviations in f.
 
virtual void jac (size_t np, vec_t &p, size_t nd, vec_t &f, mat_t &J)
 Using parameters in p, compute the Jacobian in J.
 
virtual size_t get_ndata ()
 Return the number of data points.
 

Public Attributes

jacobian_gsl< std::function< int(size_t, const vec_t &, vec_t &)>, vec_t, mat_t > auto_jac
 Automatic Jacobian object.
 

Protected Member Functions

int jac_mm_funct (size_t np, const vec_t &p, vec_t &f)
 Reformulate operator() into a mm_funct11 object.
 

Protected Attributes

std::function< int(size_t, const vec_t &, vec_t &)> mfm
 Function object for Jacobian object.
 
fit_func_t * fun_
 Fitting function.
 
Data and uncertainties
size_t ndat_
 
const vec_t * xdat_
 
const vec_t * ydat_
 
const vec_t * yerr_
 

Private Member Functions

 chi_fit_funct (const chi_fit_funct &)
 
chi_fit_functoperator= (const chi_fit_funct &)
 

Detailed Description

template<class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>, class fit_func_t = fit_funct11>
class o2scl::chi_fit_funct< vec_t, mat_t, fit_func_t >

This class specifies the deviations (in operator() ) and Jacobian (in jac()) for a fitting class like fit_nonlin. It assumes a one-dimensional data set with no uncertainty in the abcissae and a fitting function specified in a form similar to fit_funct11.

The default method for numerically computing the Jacobian is from jacobian_gsl. This default is identical to the GSL approach, except that the default value of jacobian_gsl::epsmin is non-zero. See jacobian_gsl for more details.

Default template arguments

Idea for Future:

Allow a user-specified Jacobian or make that into a separate class?

Default constructor?

Definition at line 199 of file fit_base.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).