CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ChiSquared Class Reference

#include <ChiSquared.h>

Public Member Functions

 ChiSquared (float value, float ndf)
 
float degreesOfFreedom () const
 
float lnProbability () const
 
float probability () const
 
float value () const
 

Private Attributes

float theNDF
 
float theValue
 

Detailed Description

Constructed with total chi-squared value value and number of degrees of freedom ndf.

Computes chi-squared upper tail probability, i.e. the probability that an observation, correctly described by a model with nrDOF, will give rise to a chi-squared larger than the one observed. From this, one can interpret this probability as how likely it is to observe as high (or higher) a chi-squared.

Also computes the natural logarithm of that probability, useful to compare very unlikely events, for which the probability is rounded off to 0.

Definition at line 19 of file ChiSquared.h.

Constructor & Destructor Documentation

◆ ChiSquared()

ChiSquared::ChiSquared ( float  value,
float  ndf 
)
inline

Definition at line 21 of file ChiSquared.h.

21 : theValue(value), theNDF(ndf) {}

Member Function Documentation

◆ degreesOfFreedom()

float ChiSquared::degreesOfFreedom ( ) const

Definition at line 6 of file ChiSquared.cc.

6 { return theNDF; }

References theNDF.

Referenced by lnProbability(), and probability().

◆ lnProbability()

float ChiSquared::lnProbability ( ) const

Definition at line 10 of file ChiSquared.cc.

References degreesOfFreedom(), LnChiSquaredProbability(), and value().

◆ probability()

float ChiSquared::probability ( ) const

Definition at line 8 of file ChiSquared.cc.

References ChiSquaredProbability(), degreesOfFreedom(), and value().

◆ value()

float ChiSquared::value ( ) const

Member Data Documentation

◆ theNDF

float ChiSquared::theNDF
private

Definition at line 29 of file ChiSquared.h.

Referenced by degreesOfFreedom().

◆ theValue

float ChiSquared::theValue
private

Definition at line 29 of file ChiSquared.h.

Referenced by value().

ChiSquared::degreesOfFreedom
float degreesOfFreedom() const
Definition: ChiSquared.cc:6
ChiSquared::value
float value() const
Definition: ChiSquared.cc:4
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
ChiSquared::theValue
float theValue
Definition: ChiSquared.h:29
LnChiSquaredProbability
float LnChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:17
value
Definition: value.py:1
ChiSquared::theNDF
float theNDF
Definition: ChiSquared.h:29