Changeset 671
 Timestamp:
 Oct 7, 2006, 8:25:22 AM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/c++_tools/statistics/utility.h
r648 r671 75 75 double median(const utility::vector& vec, const bool sorted=false); 76 76 77 / //78 ///The percentile is determined by the \a p, a number between 0 and79 ///100. The percentile is found by interpolation, using the formula80 ///\f$ percentile = (1  \delta) x_i + \delta x_{i+1} \f$ where \a81 ///p is floor\f$((n  1)p/100)\f$ and \f$ \delta \f$ is \f$82 ///(n1)p/100  i \f$.Thus the minimum value of the vector is given83 ///by p equal to zero, the maximum is given by p equal to 100 and84 ///the median value is given by p equal to 50. If @a sorted85 ///is false (default), the vector is copied, the copy is sorted,86 ///and then used to calculate the median.87 ///88 ///@return \a p'th percentile89 ///77 /** 78 The percentile is determined by the \a p, a number between 0 and 79 100. The percentile is found by interpolation, using the formula 80 \f$ percentile = (1  \delta) x_i + \delta x_{i+1} \f$ where \a 81 p is floor\f$((n  1)p/100)\f$ and \f$ \delta \f$ is \f$ 82 (n1)p/100  i \f$.Thus the minimum value of the vector is given 83 by p equal to zero, the maximum is given by p equal to 100 and 84 the median value is given by p equal to 50. If @a sorted 85 is false (default), the vector is copied, the copy is sorted, 86 and then used to calculate the median. 87 88 @return \a p'th percentile 89 */ 90 90 template <class T> 91 91 double percentile(const std::vector<T>& vec, const double p, … … 110 110 } 111 111 112 / //113 ///The percentile is determined by the \a p, a number between 0 and114 ///100. The percentile is found by interpolation, using the formula115 ///\f$ percentile = (1  \delta) x_i + \delta x_{i+1} \f$ where \a116 ///p is floor\f$((n  1)p/100)\f$ and \f$ \delta \f$ is \f$117 ///(n1)p/100  i \f$.Thus the minimum value of the vector is given118 ///by p equal to zero, the maximum is given by p equal to 100 and119 ///the median value is given by p equal to 50. If @a sorted120 ///is false (default), the vector is copied, the copy is sorted,121 ///and then used to calculate the median.122 ///123 ///@return \a p'th percentile124 ///112 /** 113 The percentile is determined by the \a p, a number between 0 and 114 100. The percentile is found by interpolation, using the formula 115 \f$ percentile = (1  \delta) x_i + \delta x_{i+1} \f$ where \a 116 p is floor\f$((n  1)p/100)\f$ and \f$ \delta \f$ is \f$ 117 (n1)p/100  i \f$.Thus the minimum value of the vector is given 118 by p equal to zero, the maximum is given by p equal to 100 and 119 the median value is given by p equal to 50. If @a sorted 120 is false (default), the vector is copied, the copy is sorted, 121 and then used to calculate the median. 122 123 @return \a p'th percentile 124 */ 125 125 double percentile(const utility::vector& vec, const double, 126 126 const bool sorted=false);
Note: See TracChangeset
for help on using the changeset viewer.