Ignore:
Timestamp:
Dec 26, 2006, 10:56:26 AM (16 years ago)
Author:
Jari Häkkinen
Message:

Addresses #170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/Averager.h

    r704 r718  
    7272    ///
    7373    template <typename T>
    74     void  add_values(const T& v, u_long n=1);
     74    void add_values(const T& v, u_long n=1);
    7575
    7676    /**
     
    8282       @return standard deviation divided by mean.
    8383    */
    84     inline double cv(void) const { return x_ ? std()/mean() : 0; }
     84    double cv(void) const;
    8585
    8686    ///
    8787    /// @return Mean of presented data, \f$ \frac{1}{n}\sum x_i \f$
    8888    ///
    89     inline double mean(void) const { return n_ ? x_/n_ : 0; }
     89    double mean(void) const;
    9090
    9191    ///
    9292    /// @return Number of data points
    9393    ///
    94     inline u_long n(void) const { return n_; }
     94    u_long n(void) const;
    9595
    9696    ///
     
    106106    /// \f$ \sqrt{variance()/n} \f$
    107107    ///
    108     inline double standard_error(void) const { return sqrt(variance()/n_); }
     108    double standard_error(void) const;
    109109
    110110    ///
     
    114114    /// @return The standard deviation, root of the variance().
    115115    ///
    116     inline double std(void) const { return sqrt(variance()); }
     116    double std(void) const;
    117117
    118118    ///
     
    122122    /// @return Standard deviation around \a m, root of the variance(m).
    123123    ///
    124     inline double std(double m) const { return sqrt(variance(m)); }
     124    double std(double m) const;
    125125
    126126    ///
    127127    /// @return The sum of x
    128128    ///
    129     inline double sum_x(void) const { return x_; }
     129    double sum_x(void)  const;
    130130
    131131    ///
    132132    /// @return The sum of squares
    133133    ///
    134     inline double sum_xx(void) const { return xx_; }
     134    double sum_xx(void) const;
    135135
    136136    ///
    137137    /// @return \f$ \sum_i (x_i-m)^2 \f$
    138138    ///
    139     inline double sum_xx_centered(void) const { return xx_-x_*x_/n_; }
     139    double sum_xx_centered(void)  const;
    140140
    141141    ///
     
    147147    /// @return Variance when the mean is known to be \a m.
    148148    ///
    149     inline double variance(double m) const
    150     { return n_ ? (xx_ - 2*m*x_ + m*m*n()) /n_ : 0; }
     149    double variance(double m) const;
    151150
    152151    ///
     
    158157    /// @return Estimation of variance
    159158    ///
    160     inline double variance(void) const
    161     { return n_>1 ? sum_xx_centered()/n_ : 0; }
     159    double variance(void) const;
    162160
    163161    ///
     
    169167    /// @return unbiased estimation of variance
    170168    ///
    171     inline double variance_unbiased(void) const
    172     { return (n_>1) ? sum_xx_centered()/(n_-1) : 0; }
     169    double variance_unbiased(void) const;
    173170
    174171    ///
Note: See TracChangeset for help on using the changeset viewer.