# Changeset 168 for trunk/src/Statistics.h

Ignore:
Timestamp:
Sep 23, 2004, 3:27:03 PM (18 years ago)
Message:

percentile modified (is now defined as in GSL)

File:
1 edited

### Legend:

Unmodified
 r117 /// /// @return median /// Median is defined to be value in the middle. If number of /// values is even median is the average of the two middle /// values. @return median /// double median(std::vector&); /// /// @return median /// Median is defined to be value in the middle. If number of /// values is even median is the average of the two middle /// values. @return median /// double median(std::vector&); /// /// @return \a i'th percentile /// The percentile is determined by the \a p, a number between 0 /// and 100. The percentile is found by interpolation, using the /// formula \f$percentile = (1 - \delta) x_i + \delta x_{i+1} \f$ /// where \a p is floor\f$((n - 1)p/100)\f$ and \f$\delta \f$ is /// \f$(n-1)p/100 - i \f$.Thus the minimum value of the vector is /// given by p equal to zero, the maximum is given by p equal to /// 100 and the median value is given by p equal to 50. Since the /// algorithm for computing percentiles involves interpolation /// this function always returns a floating-point number, even for /// integer data types.  @return \a i'th percentile /// double percentile(std::vector&, double i); double percentile(std::vector&, double p); /// /// @return \a i'th percentile /// The percentile is determined by the \a p, a number between 0 /// and 100. The percentile is found by interpolation, using the /// formula \f$percentile = (1 - \delta) x_i + \delta x_{i+1} \f$ /// where \a p is floor\f$((n - 1)p/100)\f$ and \f$\delta \f$ is /// \f$(n-1)p/100 - i \f$.Thus the minimum value of the vector is /// given by p equal to zero, the maximum is given by p equal to /// 100 and the median value is given by p equal to 50. Since the /// algorithm for computing percentiles involves interpolation /// this function always returns a floating-point number, even for /// integer data types.  @return \a i'th percentile /// double percentile(std::vector&, double i);