diff --git a/lib/Statistics/XYSampleData.cpp b/lib/Statistics/XYSampleData.cpp index e455518..bdb4f19 100644 --- a/lib/Statistics/XYSampleData.cpp +++ b/lib/Statistics/XYSampleData.cpp @@ -20,7 +20,6 @@ #include #include #include -// #include using namespace std; using namespace Latan; @@ -235,17 +234,17 @@ DVec XYSampleData::getYError(const Index j) return data_.getYError(j); } -void XYSampleData::setChi2PerDofBound(double uLim, double lLim) +void XYSampleData::setPValueBound(double uLim, double lLim) { - chi2PerDofu_ = uLim; - chi2PerDofl_ = lLim; + pValMax = uLim; + pValMin = lLim; } -void XYSampleData::checkChi2PerDof(double Chi2PerDof) +void XYSampleData::checkPValue(double pValue) { - if(Chi2PerDof >= chi2PerDofu_ or Chi2PerDof < chi2PerDofl_ or isnan(Chi2PerDof)) + if(pValue >= pValMax or pValue <= pValMin or isnan(pValue)) { - string msg = "central chi2perDof = " + to_string(Chi2PerDof) + " not within user-set bound of " + to_string(chi2PerDofl_) + " < chi2PerDof < " + to_string(chi2PerDofu_) ; + string msg = "central pValue = " + to_string(pValue) + " not within user-set bound of " + to_string(pValMin) + " < pValue < " + to_string(pValMax) ; LATAN_ERROR(Runtime, msg); } } diff --git a/lib/Statistics/XYSampleData.hpp b/lib/Statistics/XYSampleData.hpp index 5109b6c..f6bcb5f 100644 --- a/lib/Statistics/XYSampleData.hpp +++ b/lib/Statistics/XYSampleData.hpp @@ -92,8 +92,8 @@ public: DVec getXError(const Index i); DVec getYError(const Index j); // fit criteria - void setChi2PerDofBound(double uLim, double lLim); - void checkChi2PerDof(double Chi2PerDof); + void setPValueBound(double uLim, double lLim); + void checkPValue(double Chi2PerDof); // get total fit variance matrix and its pseudo-inverse const DMat & getFitVarMat(void); const DMat & getFitVarMatPInv(void); @@ -136,7 +136,7 @@ private: Index nSample_, dataSample_{central}; bool initData_{true}, computeVarMat_{true}; bool initXMap_{true}; - double chi2PerDofu_{1e10}, chi2PerDofl_{0}; + double pValMax{1}, pValMin{0}; }; /******************************************************************************