Simple average, min, max and std. More...
#include "average.h"
Public Member Functions | |
Average () | |
double | Avg () const |
Sample average. More... | |
uint32_t | Count () const |
Sample size. More... | |
T | Max () const |
Sample maximum. More... | |
double | Mean () const |
Sample estimate of mean, alias to Avg. More... | |
T | Min () const |
Sample minimum. More... | |
void | Reset () |
Reset statistics. More... | |
double | Stddev () const |
Sample standard deviation. More... | |
void | Update (T const &x) |
Add new sample. More... | |
double | Var () const |
Sample unbiased nbiased estimate of variance. More... | |
Error of the mean estimates | |
double | Error90 () const |
Margin of error of the mean for 90% confidence level. More... | |
double | Error95 () const |
Margin of error of the mean for 95% confidence level. More... | |
double | Error99 () const |
Margin of error of the mean for 99% confidence level. More... | |
Private Attributes | |
T | m_max |
Maximum value observed. More... | |
T | m_min |
Minimum value observed. More... | |
uint32_t | m_size |
Number of sampled data. More... | |
MinMaxAvgTotalCalculator< double > | m_varianceCalculator |
Variance calculator. More... | |
Simple average, min, max and std.
deviation calculator
|
inline |
|
inline |
Sample average.
Definition at line 91 of file average.h.
References ns3::MinMaxAvgTotalCalculator< T >::getMean(), and ns3::Average< T >::m_varianceCalculator.
Referenced by ns3::Average< T >::Mean(), and ns3::V4Ping::StopApplication().
|
inline |
Sample size.
Definition at line 76 of file average.h.
References ns3::Average< T >::m_size.
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), FiveDoublesAverageTestCase::DoRun(), ns3::Average< T >::Error90(), ns3::Average< T >::Error95(), ns3::Average< T >::Error99(), and ns3::V4Ping::StopApplication().
|
inline |
Margin of error of the mean for 90% confidence level.
Note that estimates are valid for
Definition at line 123 of file average.h.
References ns3::Average< T >::Count(), and ns3::Average< T >::Var().
|
inline |
Margin of error of the mean for 95% confidence level.
Note that estimates are valid for
Definition at line 134 of file average.h.
References ns3::Average< T >::Count(), and ns3::Average< T >::Var().
|
inline |
Margin of error of the mean for 99% confidence level.
Note that estimates are valid for
Definition at line 146 of file average.h.
References ns3::Average< T >::Count(), and ns3::Average< T >::Var().
|
inline |
Sample maximum.
Definition at line 86 of file average.h.
References ns3::Average< T >::m_max.
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), FiveDoublesAverageTestCase::DoRun(), and ns3::V4Ping::StopApplication().
|
inline |
Sample estimate of mean, alias to Avg.
Definition at line 96 of file average.h.
References ns3::Average< T >::Avg().
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), and FiveDoublesAverageTestCase::DoRun().
|
inline |
Sample minimum.
Definition at line 81 of file average.h.
References ns3::Average< T >::m_min.
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), FiveDoublesAverageTestCase::DoRun(), and ns3::V4Ping::StopApplication().
|
inline |
Reset statistics.
Definition at line 62 of file average.h.
References ns3::Average< T >::m_max, ns3::Average< T >::m_min, ns3::Average< T >::m_size, ns3::Average< T >::m_varianceCalculator, max, and ns3::MinMaxAvgTotalCalculator< T >::Reset().
|
inline |
Sample standard deviation.
Definition at line 106 of file average.h.
References ns3::Average< T >::Var().
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), FiveDoublesAverageTestCase::DoRun(), and ns3::V4Ping::StopApplication().
|
inline |
Add new sample.
x | The sample |
Definition at line 52 of file average.h.
References ns3::Average< T >::m_max, ns3::Average< T >::m_min, ns3::Average< T >::m_size, ns3::Average< T >::m_varianceCalculator, max, min, ns3::MinMaxAvgTotalCalculator< T >::Update(), and sample-rng-plot::x.
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), FiveDoublesAverageTestCase::DoRun(), and ns3::V4Ping::Receive().
|
inline |
Sample unbiased nbiased estimate of variance.
Definition at line 101 of file average.h.
References ns3::MinMaxAvgTotalCalculator< T >::getVariance(), and ns3::Average< T >::m_varianceCalculator.
Referenced by OneIntegerAverageTestCase::DoRun(), FiveIntegersAverageTestCase::DoRun(), FiveDoublesAverageTestCase::DoRun(), ns3::Average< T >::Error90(), ns3::Average< T >::Error95(), ns3::Average< T >::Error99(), and ns3::Average< T >::Stddev().
|
private |
Maximum value observed.
Definition at line 152 of file average.h.
Referenced by ns3::Average< T >::Max(), ns3::Average< T >::Reset(), and ns3::Average< T >::Update().
|
private |
Minimum value observed.
Definition at line 151 of file average.h.
Referenced by ns3::Average< T >::Min(), ns3::Average< T >::Reset(), and ns3::Average< T >::Update().
|
private |
Number of sampled data.
Definition at line 150 of file average.h.
Referenced by ns3::Average< T >::Count(), ns3::Average< T >::Reset(), and ns3::Average< T >::Update().
|
private |
Variance calculator.
Definition at line 153 of file average.h.
Referenced by ns3::Average< T >::Avg(), ns3::Average< T >::Reset(), ns3::Average< T >::Update(), and ns3::Average< T >::Var().