CMS 3D CMS Logo

ChiSquared Class Reference

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

#include <CommonTools/Statistics/interface/ChiSquared.h>

List of all members.

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 20 of file ChiSquared.h.


Constructor & Destructor Documentation

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

Definition at line 24 of file ChiSquared.h.

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


Member Function Documentation

float ChiSquared::degreesOfFreedom (  )  const

Definition at line 11 of file ChiSquared.cc.

References theNDF.

Referenced by lnProbability(), and probability().

00012 {
00013   return theNDF;
00014 }

float ChiSquared::lnProbability (  )  const

Definition at line 23 of file ChiSquared.cc.

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

00024 {
00025   return LnChiSquaredProbability(value(), degreesOfFreedom());
00026 }

float ChiSquared::probability (  )  const

Definition at line 17 of file ChiSquared.cc.

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

00018 {
00019   return ChiSquaredProbability(value(), degreesOfFreedom());
00020 }

float ChiSquared::value (  )  const

Definition at line 5 of file ChiSquared.cc.

References theValue.

Referenced by lnProbability(), and probability().

00006 {
00007   return theValue;
00008 }


Member Data Documentation

float ChiSquared::theNDF [private]

Definition at line 33 of file ChiSquared.h.

Referenced by degreesOfFreedom().

float ChiSquared::theValue [private]

Definition at line 33 of file ChiSquared.h.

Referenced by value().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:19 2009 for CMSSW by  doxygen 1.5.4