13 #include "msdevstudio/MSconfig.h"
24 #ifdef ITERATOR_MEMBER_DEFECT
32 Chi2Dist::Chi2Dist ( )
37 Chi2Dist::Chi2Dist (
double norm,
double nu,
double scale )
46 void Chi2Dist::initialize ()
48 m_name =
"Chi-square dist.";
49 m_parm_names.push_back (
"Norm" );
50 m_parm_names.push_back (
"#dof" );
51 m_parm_names.push_back (
"x scale" );
61 double Chi2Dist::operator () (
double x )
const
63 return m_parms[0]*exp( -x/2./m_parms[2])
64 *pow(x/2./m_parms[2], m_parms[1]/2. - 1. );
75 m_parms[0] = helper->
maxValue()/operator()(m_parms[1]);
78 double Chi2Dist::derivByParm (
int i,
double x )
const
82 return operator()(x)/m_parms[0];
86 return operator()(x)/2.*log(x/2./m_parms[2]);
90 return operator()(x)*(x/2./m_parms[2] - (m_parms[1]/2.-1.))/m_parms[2];
chi-squared distribution class interface
FunctionHelper class interface.
numeric::array clone(numeric::array arr)
virtual double maxValue() const =0
Returns the largest value in the data set.
A function that can be added to a DataRep and used in a fitter.
double norm(const std::vector< double > &a)
Computes the two norm of the vector.
An abstract base class to help FunctionBase objects perform some operations.
virtual double meanCoord() const =0
Returns the mean of the coordinates along a X axis in the data set.
A function can be used with a fitter.