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 | Ex |
double | Ex2 |
T | K |
Friends | |
std::istream & | operator>> (std::istream &input, stats_computer1 &stat) |
continuous mean and variance computance using first value as an approximation for the mean. If the first number is much far form the mean, the algorithm becomes very inaccurate to compute variance and standard deviation.
Definition at line 27 of file realtime_stats.cpp.
|
inline |
return sample mean computed till last sample
Definition at line 42 of file realtime_stats.cpp.
|
inline |
Constructor
[in] | x | new data sample |
Definition at line 32 of file realtime_stats.cpp.
|
inline |
return sample standard deviation computed till last sample
Definition at line 48 of file realtime_stats.cpp.
|
inline |
return data variance computed till last sample
Definition at line 45 of file realtime_stats.cpp.
|
friend |
short-hand operator to read new sample from input stream
e.g.: std::cin >> stats1;
Definition at line 53 of file realtime_stats.cpp.
|
private |
Definition at line 63 of file realtime_stats.cpp.
|
private |
Definition at line 63 of file realtime_stats.cpp.
|
private |
Definition at line 64 of file realtime_stats.cpp.
|
private |
Definition at line 62 of file realtime_stats.cpp.