|
Momentum Scripting v1
|
#include <Statistic.h>
Public Member Functions | |
| ExponentialMovingAverageStatistic (double smoothFactor, double initialObservation=0) | |
| virtual | ~ExponentialMovingAverageStatistic () |
| double | get () const |
| double | getSmoothFactor () const |
| void | set (double val) |
| void | setSmoothFactor (double smoothFactor) |
| virtual double | update (double observation) |
Protected Attributes | |
| double | m_s |
| double | m_smoothFactor |
Exponential moving average statistic.
At observation 



| v1::ExponentialMovingAverageStatistic::ExponentialMovingAverageStatistic | ( | double | smoothFactor, |
| double | initialObservation = 0 |
||
| ) |
| smoothFactor | - the smoothing factor used to propagate the average (must be between zero and one) |
| initialObservation | - initial observation, default zero (optional) |
|
virtual |
|
virtual |
Implements v1::Statistic.
| double v1::ExponentialMovingAverageStatistic::getSmoothFactor | ( | ) | const |
| void v1::ExponentialMovingAverageStatistic::set | ( | double | val | ) |
Set the raw value of the statistic scalar.
This will be stored without any smoothing. Can be used to initialize the object to a specific value.
| void v1::ExponentialMovingAverageStatistic::setSmoothFactor | ( | double | smoothFactor | ) |
| the | smoothing factor |
|
virtual |
Updates the statistic given the current observation and returns the current value of this statistic.
| observation | - the current observation |
Implements v1::Statistic.
|
protected |
|
protected |