# Changeset 1422 for trunk/yat/statistics/Percentiler.h

Ignore:
Timestamp:
Aug 20, 2008, 8:43:09 PM (13 years ago)
Message:

docs - fixes #366

File:
1 edited

### Legend:

Unmodified
 r1420 public: /** \param perc percentile to calculate [0,100]. Defaule value is \param perc percentile to calculate [0,100]. Default value is 50, which implies class will calculate median. \param sorted if true class assumes that ranges are already Function is a non-mutable function, i.e., \a first and \a last can be const_iterators. The \a Nth percentile is defined such that, for example, when having four numbers \f$0.69 < 1.41 < 3.14 < 28 \f$, the \a Nth percentile is: - \f$0.69 \f$ if \f$N < 25 \f$ - \f$(0.69+1.41)/2 \f$ if \f$N=25 \f$ - \f$1.41 \f$ if \f$25 < N < 50 \f$ - \f$(1.41+3.14)/2 \f$ if \f$N=50 \f$ - \f$3.14 \f$ if \f$50 < N < 75 \f$ - \f$(3.14+28)/2 \f$ if \f$N=75 \f$ - \f$28 \f$ if \f$75 < N \f$ Similarily, if we have a weighted range \f$x_0=0.69, w_0=1 ; x_1=1.41, w_1=0 ; x_2=3.14, w_2=0.5 ; x_3=28, w_3=0.5 \f$, we calculate the accumulated normalized weight \f$S_k = \frac {100}{\sum w_i}\sum_{i=0}^k w_i \f$ and the percentile is - \f$0.69 \f$ if \f$N < S_0 \f$ - \f$(0.69+3.14)/2 \f$ if \f$N=S_0 \f$ - \f$3.14 \f$ if \f$S_0 < N < S_2 \f$ - \f$(3.14+28)/2 \f$ if \f$N=S_2 \f$ - \f$28 \f$ if \f$S_2 < N \f$ Note, that data point with weight zero is completely ignored. \return percentile of range