Changeset 168 for trunk/src/Statistics.h


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

percentile modified (is now defined as in GSL)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Statistics.h

    r117 r168  
    2727
    2828    ///
    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
    3032    ///
    3133    double median(std::vector<double>&); 
    3234
    3335    ///
    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
    3539    ///
    3640    double median(std::vector<size_t>&); 
    3741
    3842    ///
    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$ (n-1)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 floating-point number, even for
     52    /// integer data types.  @return \a i'th percentile
    4053    ///
    41     double percentile(std::vector<double>&, double i);
     54    double percentile(std::vector<double>&, double p);
    4255
    4356    ///
    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$ (n-1)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 floating-point number, even for
     66    /// integer data types.  @return \a i'th percentile
    4567    ///
    4668    double percentile(std::vector<size_t>&, double i);
Note: See TracChangeset for help on using the changeset viewer.