37 #include <zeusbase/System/ArrayList.hpp> 38 #include <zeusbase/System/Pair.hpp> 55 TDistribution(
const TArrayList<Float>& rlstData,
bool bDataAsProbabilities);
56 TDistribution(
const Float* pafData, Int iArraySize,
bool bDataAsProbabilities);
57 TDistribution(
const Float* pafSampleData,
const Float* pafProb, Int iArraySize);
64 virtual Float MQUALIFIER getEntropy()
const;
65 virtual Float MQUALIFIER getExpectedValue()
const;
66 virtual Float MQUALIFIER getMean()
const;
67 virtual Float MQUALIFIER getMedian()
const;
68 virtual Float MQUALIFIER getVariance()
const;
69 virtual Float MQUALIFIER getMode()
const;
70 virtual Float MQUALIFIER getSkewness()
const;
71 virtual Float MQUALIFIER getCumulativeProb(
const Float& rfStart,
const Float& rfEnd)
const;
72 virtual Float MQUALIFIER getStdDeviation()
const;
73 virtual Float MQUALIFIER getProb(
const Float& rfX)
const;
74 virtual Float MQUALIFIER getSampleProb(Int iSample)
const;
79 Int getSampleCount()
const;
80 Float getSampleValue(Int iIndex)
const;
81 Float getProbabilitySum()
const;
82 Float getMaximumSampleValue()
const;
83 Float getMinimumSampleValue()
const;
86 static Float getMean(
const TArrayList<Float>& rlstData);
87 static Float getMean(
const Float* pafData, Int iCount);
89 static Float getMedian(
const TArrayList<Float>& rlstData);
90 static Float getMedian(
const Float* pafData, Int iCount);
91 static Float getMedian(
const Float* pafData, Int iCount, Float fTotalArea);
93 static Float getStdDeviation(
const TArrayList<Float>& rlstData);
94 static Float getStdDeviation(
const Float* pafData, Int iCount);
100 TArrayList<TMappedValue> m_lstData;
102 void create(
const Float* pafSampleData,
const Float* pafProb, Int iArraySize);
110 inline Float MQUALIFIER TDistribution::getStdDeviation()
const 112 return TMath::sqrt(getVariance());
119 inline Float MQUALIFIER TDistribution::getProb(
const Float& )
const 128 inline Float MQUALIFIER TDistribution::getSampleProb(Int iSample)
const 130 return getSampleConst(iSample).getSecondConst();
139 inline const TMappedValue& TDistribution::getSampleConst(Int iIndex)
const 141 return m_lstData.getItemConst(iIndex);
152 return m_lstData.getItem(iIndex);
159 inline Int TDistribution::getSampleCount()
const 161 return m_lstData.getCount();
170 inline Float TDistribution::getSampleValue(Int iIndex)
const 172 return getSampleConst(iIndex).getFirstConst();
180 inline Float TDistribution::getProbabilitySum()
const 182 return getCumulativeProb(0, m_lstData.getCount()-1);
189 inline Float TDistribution::getMean(
const TArrayList<Float>& rlstData)
191 return TDistribution::getMean(rlstData.getArrayConst(), rlstData.getCount());
198 inline Float TDistribution::getMedian(
const TArrayList<Float>& rlstData)
200 return TDistribution::getMedian(rlstData.getArrayConst(), rlstData.getCount());
207 inline Float TDistribution::getMedian(
const Float* pafData, Int iCount)
211 for (Int i = 0; i < iCount; i++)
213 fTotal += pafData[i];
215 return TDistribution::getMedian(pafData, iCount, fTotal);
222 inline Float TDistribution::getStdDeviation(
const TArrayList<Float>& rlstData)
224 return TDistribution::getStdDeviation(rlstData.getArrayConst(), rlstData.getCount());
TPair< Float, Float > TMappedValue
Definition: Distribution.h:44
Definition: IDistribution.hpp:45
Definition: Distribution.h:52