mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-06-18 15:27:05 +01:00
p-value now 2-sided and added chi^2 CCDF
This commit is contained in:
@ -62,6 +62,11 @@ double SampleFitResult::getPValue(const Index s) const
|
||||
return Math::chi2PValue(getChi2(s), getNDof());
|
||||
}
|
||||
|
||||
double SampleFitResult::getCcdf(const Index s) const
|
||||
{
|
||||
return Math::chi2Ccdf(getChi2(s), getNDof());
|
||||
}
|
||||
|
||||
const DoubleFunction & SampleFitResult::getModel(const Index s,
|
||||
const Index j) const
|
||||
{
|
||||
@ -98,8 +103,9 @@ void SampleFitResult::print(const bool printXsi, ostream &out) const
|
||||
Index pMax = printXsi ? size() : nPar_;
|
||||
DMat err = this->variance().cwiseSqrt();
|
||||
|
||||
sprintf(buf, "chi^2/dof= %.1e/%d= %.2e -- p-value= %.2e", getChi2(),
|
||||
static_cast<int>(getNDof()), getChi2PerDof(), getPValue());
|
||||
sprintf(buf, "chi^2/dof= %.1e/%d= %.2e -- chi^2 CCDF= %.2e -- p-value= %.2e",
|
||||
getChi2(), static_cast<int>(getNDof()), getChi2PerDof(), getCcdf(),
|
||||
getPValue());
|
||||
out << buf << endl;
|
||||
for (Index p = 0; p < pMax; ++p)
|
||||
{
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
double getNDof(void) const;
|
||||
Index getNPar(void) const;
|
||||
double getPValue(const Index s = central) const;
|
||||
double getCcdf(const Index s = central) const;
|
||||
const DoubleFunction & getModel(const Index s = central,
|
||||
const Index j = 0) const;
|
||||
const DoubleFunctionSample & getModel(const PlaceHolder ph,
|
||||
|
@ -55,6 +55,11 @@ double FitResult::getPValue(void) const
|
||||
return Math::chi2PValue(getChi2(), getNDof());;
|
||||
}
|
||||
|
||||
double FitResult::getCcdf(void) const
|
||||
{
|
||||
return Math::chi2Ccdf(getChi2(), getNDof());;
|
||||
}
|
||||
|
||||
const DoubleFunction & FitResult::getModel(const Index j) const
|
||||
{
|
||||
return model_[j];
|
||||
@ -66,8 +71,9 @@ void FitResult::print(const bool printXsi, ostream &out) const
|
||||
char buf[256];
|
||||
Index pMax = printXsi ? size() : nPar_;
|
||||
|
||||
sprintf(buf, "chi^2/dof= %.1e/%d= %.2e -- p-value= %.2e", getChi2(),
|
||||
static_cast<int>(getNDof()), getChi2PerDof(), getPValue());
|
||||
sprintf(buf, "chi^2/dof= %.1e/%d= %.2e -- chi^2 CCDF= %.2e -- p-value= %.2e",
|
||||
getChi2(), static_cast<int>(getNDof()), getChi2PerDof(), getCcdf(),
|
||||
getPValue());
|
||||
out << buf << endl;
|
||||
for (Index p = 0; p < pMax; ++p)
|
||||
{
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
double getNDof(void) const;
|
||||
Index getNPar(void) const;
|
||||
double getPValue(void) const;
|
||||
double getCcdf(void) const;
|
||||
const DoubleFunction & getModel(const Index j = 0) const;
|
||||
// IO
|
||||
void print(const bool printXsi = false,
|
||||
|
Reference in New Issue
Block a user