Class to calculate simple (first and second moments) averages.
More...
#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/statistics/Averager.h>
List of all members.
Public Member Functions |
| Averager (void) |
| Averager (double x, double xx, long n) |
| Averager (const Averager &a) |
const Averager & | operator= (const Averager &) |
| The assignment operator.
|
template<class Derived > |
const Averager & | operator+= (const averager_base2< Derived > &other) |
| plus assignment operator
|
double | cv (void) const |
| Coeffient of variation.
|
double | standard_error (void) const |
double | std (void) const |
| The standard deviation is defined as the square root of the variance.
|
double | std (double m) const |
| The standard deviation is defined as the square root of the variance.
|
double | sum_xx (void) const |
double | sum_xx_centered (void) const |
double | variance (double m) const |
| The variance with known mean.
|
double | variance (void) const |
| The estimated variance.
|
double | variance_unbiased (void) const |
void | add (double x, long n=1) |
| add a data point
|
double | mean (void) const |
| mean
|
long | n (void) const |
| number of data points
|
void | rescale (double a) |
| Rescales the object.
|
void | reset (void) |
| Reset object.
|
double | sum_x (void) const |
Protected Member Functions |
void | add2 (double mean, double cm2, long int n) |
void | add2 (double delta) |
double | rescale2 (double x) |
void | add1 (double x, long int n) |
void | add1 (double delta) |
double | rescale1 (double x) |
Protected Attributes |
double | cm2_ |
long int | n_ |
double | mean_ |
| mean
|
Friends |
class | averager_base< Averager > |
Related Functions |
(Note that these are not member functions.)
|
template<typename InputIterator > |
void | add (Averager &a, InputIterator first, InputIterator last) |
| adding a range of values to Averager a
|
Detailed Description
Class to calculate simple (first and second moments) averages.
- See also:
- AveragerWeighted AveragerPair AveragerPairWeighted
Constructor & Destructor Documentation
theplu::yat::statistics::Averager::Averager |
( |
void |
| ) |
|
theplu::yat::statistics::Averager::Averager |
( |
double |
x, |
|
|
double |
xx, |
|
|
long |
n |
|
) |
| |
Constructor taking sum of x, sum of squared x, xx, and number of samples n.
theplu::yat::statistics::Averager::Averager |
( |
const Averager & |
a | ) |
|
Member Function Documentation
add a data point
Adding n number of data point(s) with value x.
add n data points with value x
add one data point with value delta + mean()
add a set of n data points with mean mean and centralized squaed sum cm
add one data point with value delta + mean()
Coeffient of variation.
Coeffient of variation (cv) is defined as ratio between the standard deviation and the mean: .
- Returns:
- standard deviation divided by mean.
mean
- Returns:
- Mean of presented data,
number of data points
- Returns:
- Number of data points
plus assignment operator
Add another Averager
Rescales the object.
,
rescale as
rescales and calles rescale1(double)
Reset object.
Restore Averager as if data were never added
\return Standard error, i.e. standard deviation of the mean
The standard deviation is defined as the square root of the variance.
- Returns:
- The standard deviation, root of the variance().
The standard deviation is defined as the square root of the variance.
- Returns:
- Standard deviation around m, root of the variance(m).
- Returns:
- The sum of data values
- Returns:
- The sum of squares
- Returns:
-
The variance with known mean.
The variance is calculated as
.
\return Variance when the mean is known to be \a m.
The estimated variance.
The variance is calculated as , where is the mean.
- Returns:
- Estimation of variance
The variance is calculated using the \form#230 correction,
which means it is the best unbiased estimator of the variance
, where is the mean.
- Returns:
- unbiased estimation of variance
Member Data Documentation
sum of values squared values centralized
The documentation for this class was generated from the following file:
- /scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/statistics/Averager.h