Changeset 1422 for trunk/yat/statistics
 Timestamp:
 Aug 20, 2008, 8:43:09 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/statistics/Percentiler.h
r1420 r1422 52 52 public: 53 53 /** 54 \param perc percentile to calculate [0,100]. Defaul evalue is54 \param perc percentile to calculate [0,100]. Default value is 55 55 50, which implies class will calculate median. 56 56 \param sorted if true class assumes that ranges are already … … 63 63 Function is a nonmutable function, i.e., \a first and \a last 64 64 can be const_iterators. 65 66 The \a Nth percentile is defined such that, for example, when 67 having four numbers \f$ 0.69 < 1.41 < 3.14 < 28 \f$, the \a Nth 68 percentile is: 69 70  \f$ 0.69 \f$ if \f$ N < 25 \f$ 71  \f$ (0.69+1.41)/2 \f$ if \f$ N=25 \f$ 72  \f$ 1.41 \f$ if \f$ 25 < N < 50 \f$ 73  \f$ (1.41+3.14)/2 \f$ if \f$ N=50 \f$ 74  \f$ 3.14 \f$ if \f$ 50 < N < 75 \f$ 75  \f$ (3.14+28)/2 \f$ if \f$ N=75 \f$ 76  \f$ 28 \f$ if \f$ 75 < N \f$ 77 78 Similarily, if we have a weighted range \f$ x_0=0.69, w_0=1 ; 79 x_1=1.41, w_1=0 ; x_2=3.14, w_2=0.5 ; x_3=28, w_3=0.5 \f$, we 80 calculate the accumulated normalized weight \f$ S_k = \frac 81 {100}{\sum w_i}\sum_{i=0}^k w_i \f$ and the percentile is 82 83  \f$ 0.69 \f$ if \f$ N < S_0 \f$ 84  \f$ (0.69+3.14)/2 \f$ if \f$ N=S_0 \f$ 85  \f$ 3.14 \f$ if \f$ S_0 < N < S_2 \f$ 86  \f$ (3.14+28)/2 \f$ if \f$ N=S_2 \f$ 87  \f$ 28 \f$ if \f$ S_2 < N \f$ 88 89 Note, that data point with weight zero is completely ignored. 65 90 66 91 \return percentile of range
Note: See TracChangeset
for help on using the changeset viewer.