Changeset 168 for trunk/src/Statistics.h
 Timestamp:
 Sep 23, 2004, 3:27:03 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/Statistics.h
r117 r168 27 27 28 28 /// 29 /// @return median 29 /// Median is defined to be value in the middle. If number of 30 /// values is even median is the average of the two middle 31 /// values. @return median 30 32 /// 31 33 double median(std::vector<double>&); 32 34 33 35 /// 34 /// @return median 36 /// Median is defined to be value in the middle. If number of 37 /// values is even median is the average of the two middle 38 /// values. @return median 35 39 /// 36 40 double median(std::vector<size_t>&); 37 41 38 42 /// 39 /// @return \a i'th percentile 43 /// The percentile is determined by the \a p, a number between 0 44 /// and 100. The percentile is found by interpolation, using the 45 /// formula \f$ percentile = (1  \delta) x_i + \delta x_{i+1} \f$ 46 /// where \a p is floor\f$((n  1)p/100)\f$ and \f$ \delta \f$ is 47 /// \f$ (n1)p/100  i \f$.Thus the minimum value of the vector is 48 /// given by p equal to zero, the maximum is given by p equal to 49 /// 100 and the median value is given by p equal to 50. Since the 50 /// algorithm for computing percentiles involves interpolation 51 /// this function always returns a floatingpoint number, even for 52 /// integer data types. @return \a i'th percentile 40 53 /// 41 double percentile(std::vector<double>&, double i);54 double percentile(std::vector<double>&, double p); 42 55 43 56 /// 44 /// @return \a i'th percentile 57 /// The percentile is determined by the \a p, a number between 0 58 /// and 100. The percentile is found by interpolation, using the 59 /// formula \f$ percentile = (1  \delta) x_i + \delta x_{i+1} \f$ 60 /// where \a p is floor\f$((n  1)p/100)\f$ and \f$ \delta \f$ is 61 /// \f$ (n1)p/100  i \f$.Thus the minimum value of the vector is 62 /// given by p equal to zero, the maximum is given by p equal to 63 /// 100 and the median value is given by p equal to 50. Since the 64 /// algorithm for computing percentiles involves interpolation 65 /// this function always returns a floatingpoint number, even for 66 /// integer data types. @return \a i'th percentile 45 67 /// 46 68 double percentile(std::vector<size_t>&, double i);
Note: See TracChangeset
for help on using the changeset viewer.