32 #ifndef PoissonDistributionH 33 #define PoissonDistributionH 37 #include <zeusbase/System/Float.h> 65 static Float getProbability(
const Float& rfLambda,
const Float& rfX);
68 virtual Float MQUALIFIER getEntropy()
const;
69 virtual Float MQUALIFIER getExpectedValue()
const;
70 virtual Float MQUALIFIER getMean()
const;
71 virtual Float MQUALIFIER getMedian()
const;
72 virtual Float MQUALIFIER getVariance()
const;
73 virtual Float MQUALIFIER getMode()
const;
74 virtual Float MQUALIFIER getSkewness()
const;
75 virtual Float MQUALIFIER getCumulativeProb(
const Float& rfStart,
const Float& rfEnd)
const;
76 virtual Float MQUALIFIER getStdDeviation()
const;
77 virtual Float MQUALIFIER getProb(
const Float& rfX)
const;
78 virtual Float MQUALIFIER getSampleProb(Int iSample)
const;
84 static Float getCumulativeProb_internal(
const Float& rfLambda,
const Float& rfEnd);
92 inline Float MQUALIFIER TPoissonDistribution::getEntropy()
const 94 return 0.5 * TMath::ln(TConstants::Pi * TMath::exp(1)*m_fLambda) - 1.0/(12*m_fLambda) -
95 1.0/(241*m_fLambda*m_fLambda) - 19.0/(360*m_fLambda*m_fLambda*m_fLambda);
102 inline Float MQUALIFIER TPoissonDistribution::getExpectedValue()
const 111 inline Float MQUALIFIER TPoissonDistribution::getMean()
const 120 inline Float MQUALIFIER TPoissonDistribution::getMedian()
const 123 return TMath::floor(m_fLambda + 1.0/3.0 - 0.02/m_fLambda);
130 inline Float MQUALIFIER TPoissonDistribution::getVariance()
const 139 inline Float MQUALIFIER TPoissonDistribution::getStdDeviation()
const 141 return TMath::sqrt(m_fLambda);
148 inline Float MQUALIFIER TPoissonDistribution::getMode()
const 150 Float fRetval = TMath::floor(m_fLambda);
153 if (TFloat::equalsFloat(m_fLambda, fRetval))
155 fRetval = m_fLambda - 1;
164 inline Float MQUALIFIER TPoissonDistribution::getSkewness()
const 166 return TMath::pow(m_fLambda, -0.5);
173 inline Float MQUALIFIER TPoissonDistribution::getProb(
const Float& rfX)
const 175 return TPoissonDistribution::getProbability(m_fLambda, rfX);
182 inline Float MQUALIFIER TPoissonDistribution::getSampleProb(Int iSample)
const 184 return TPoissonDistribution::getProbability(m_fLambda, iSample);
195 inline Float TPoissonDistribution::getProbability(
const Float& rfLambda,
const Float& rfX)
197 return TMath::pow(rfLambda, rfX) / TFloat::getFactorial(rfX) * TMath::exp(-rfLambda);
Definition: PoissonDistribution.h:46
TPoissonDistribution(const Float &rfLambda)
Definition: PoissonDistribution.h:54
Definition: IDistribution.hpp:45
virtual ~TPoissonDistribution()
Definition: PoissonDistribution.h:63