TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Public Member Functions | |
void | new_val (T x) |
double | mean () const |
double | variance () const |
double | std () const |
Private Attributes | |
unsigned int | n = 0 |
double | mu = 0 |
double | var = 0 |
double | M = 0 |
Friends | |
std::istream & | operator>> (std::istream &input, stats_computer2 &stat) |
continuous mean and variance computance using Welford's algorithm (very accurate)
Definition at line 72 of file realtime_stats.cpp.
|
inline |
return sample mean computed till last sample
Definition at line 86 of file realtime_stats.cpp.
|
inline |
Constructor
[in] | x | new data sample |
Definition at line 77 of file realtime_stats.cpp.
|
inline |
return sample standard deviation computed till last sample
Definition at line 92 of file realtime_stats.cpp.
|
inline |
return data variance computed till last sample
Definition at line 89 of file realtime_stats.cpp.
|
friend |
short-hand operator to read new sample from input stream
e.g.: std::cin >> stats1;
Definition at line 97 of file realtime_stats.cpp.
|
private |
Definition at line 107 of file realtime_stats.cpp.
|
private |
Definition at line 107 of file realtime_stats.cpp.
|
private |
Definition at line 106 of file realtime_stats.cpp.
|
private |
Definition at line 107 of file realtime_stats.cpp.