WARNING: this class is work in progress, don't use it yet. More...
#include <RollingStat.h>
Public Member Functions | |
RollingStat () | |
Constructor. | |
void | update (T x) |
Update the mean and variance given a new input value. More... | |
void | update (int8_t x) |
Update the mean and variance given a new input value. More... | |
T | getMean () const |
Return the mean of the last WINDOW_LENGTH number of inputs. More... | |
T | getVariance () const |
Return the approximate variance of the last WINDOW_LENGTH number of inputs. More... | |
T | getStandardDeviation () const |
Return the approximate standard deviation of the last WINDOW_LENGTH number of inputs. More... | |
WARNING: this class is work in progress, don't use it yet.
Calculates an approximation of the variance and standard deviation for a window of recent inputs.
T | the type of numbers to use. Choose unsigned int, int , uint8_t, int8_t, or float |
WINDOW_LENGTH | how many recent input values to include in the calculations. |
Definition at line 28 of file RollingStat.h.
|
inline |
Return the mean of the last WINDOW_LENGTH number of inputs.
Definition at line 61 of file RollingStat.h.
|
inline |
Return the approximate standard deviation of the last WINDOW_LENGTH number of inputs.
Definition at line 78 of file RollingStat.h.
|
inline |
Return the approximate variance of the last WINDOW_LENGTH number of inputs.
Definition at line 71 of file RollingStat.h.
|
inline |
Update the mean and variance given a new input value.
x | the next input value |
Definition at line 41 of file RollingStat.h.
|
inline |
Update the mean and variance given a new input value.
x | the next input value |
Definition at line 51 of file RollingStat.h.