Multidimensional fitting class fixing some parameters and varying others. More...
#include <fit_fix.h>
Public Types | |
typedef fit_base< fit_fix_pars< bool_vec_t, func_t, vec_t, mat_t >, vec_t, mat_t > | base_fit_t |
The generic fitter type. | |
typedef fit_nonlin< fit_fix_pars< bool_vec_t, func_t, vec_t, mat_t >, vec_t, mat_t > | def_fit_t |
The default fitter type. | |
Public Member Functions | |
fit_fix_pars () | |
Specify the member function pointer. | |
virtual int | fit (size_t np, 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... | |
virtual int | fit_fix (size_t np, vec_t &par, mat_t &covar, double &chi2, func_t &fitfun, bool_vec_t &fix) |
Fit function func while fixing some parameters as specified in fix . More... | |
int | set_fit (base_fit_t &fitter) |
Change the base fitter. | |
Reimplementation of \ref gen_fit_funct | |
virtual size_t | get_ndata () |
The function to return the number of data points. | |
virtual void | operator() (size_t np_new, const vec_t &par_new, size_t nd, vec_t &f) |
The function computing deviations. More... | |
virtual void | jac (size_t np_new, vec_t &par_new, size_t nd, vec_t &f, mat_t &J_new) |
The function computing the Jacobian. | |
![]() | |
virtual int | print_iter (size_t nv, vec_t &x, double y, int iter, double value=0.0, double limit=0.0) |
Print out iteration information. More... | |
virtual const char * | type () |
Return string denoting type ("fit_base") | |
Public Attributes | |
bool | expand_covar |
If true, expand the covariance matrix to the larger space by filling with the identity matrix (default false) More... | |
def_fit_t | def_fit |
The default base fitter. | |
![]() | |
size_t | ntrial |
Maximum number of iterations (default 500) | |
double | tol_abs |
Absolute tolerance (default 1.0e-4) | |
double | tol_rel |
(default 1.0e-4) | |
int | verbose |
An integer describing the verbosity of the output. | |
size_t | n_dat |
The number of data points. | |
size_t | n_par |
The number of parameters. | |
Protected Attributes | |
vec_t | u_par |
Temporary vector to store full parameter list of size u_np. | |
vec_t | u_par_new |
Vector for smaller parameter list of size u_np_new. | |
mat_t | J |
Jacobian in the user space of size (nd,u_np) | |
base_fit_t * | fitp |
The fitter. | |
func_t * | funcp |
The user-specified function. | |
size_t | u_np |
The user-specified number of variables. | |
size_t | u_np_new |
The new number of variables. | |
bool_vec_t * | fix_par |
Specify which parameters to fix (vector of size u_np) | |
vec_t * | x_par |
The user-specified initial vector of size u_np. | |
Private Member Functions | |
fit_fix_pars (const fit_fix_pars &) | |
fit_fix_pars & | operator= (const fit_fix_pars &) |
The number of trials used in the fit can be specified in the data member of the parent class fit_base::ntrial associated with the fit_fix_pars object. Similarly for the verbosity parameter in fit_base::verbose, the absolute tolerance in fit_base::tol_abs, and the relative tolerance in fit_base::tol_abs. These values are copied to the minimizer used by fit_fix_pars::mmin()
during each call. After the minimizer is called, the value of fit_base::ntrial associated with the fit_fix_pars object is filled with the last number of trials required for the last minimization.
Default template arguments
func_t
- gen_fit_funct<>vec_t
- boost::numeric::ublas::vector <double >mat_t
- boost::numeric::ublas::matrix <double >
|
inlinevirtual |
The covariance matrix for the parameters is returned in covar
and the value of is returned in
chi2
.
Implements o2scl::fit_base< func_t, vec_t, mat_t >.
|
inlinevirtual |
|
inlinevirtual |
This function operates in the smaller space of size np_new.
Implements o2scl::gen_fit_funct< vec_t, mat_t >.
bool o2scl::fit_fix_pars< bool_vec_t, func_t, vec_t, mat_t >::expand_covar |
If this varable is false (the default), then the covariance matrix is computed in the smaller space which enumerates only the parameters which are not fixed. If this variable is true, then the covariance matrix must be a full np
by np
matrix (where np
is the argument to fit() or fit_fix() ) and rows and columns which correspond with parameters which are fixed are replaced by elements from the identity matrix.
The optimal parameters and reported by the fit are unchanged.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).