|
AGX Dynamics 2.41.1.2
|
Exponential moving average statistic. More...
#include <Statistic.h>
Inheritance diagram for agxUtil::ExponentialMovingAverageStatistic:Public Member Functions | |
| ExponentialMovingAverageStatistic (agx::Real smoothFactor, agx::Real initialObservation=0) | |
| virtual | ~ExponentialMovingAverageStatistic () |
| virtual agx::Real | get () const |
| agx::Real | getSmoothFactor () const |
| void | set (agx::Real val) |
| Set the raw value of the statistic scalar. | |
| void | setSmoothFactor (agx::Real smoothFactor) |
| virtual agx::Real | update (agx::Real observation) |
| Updates the statistic given the current observation and returns the current value of this statistic. | |
Public Member Functions inherited from agxUtil::Statistic | |
| virtual | ~Statistic () |
| virtual agx::Real | get () const =0 |
| virtual agx::Real | update (agx::Real observation)=0 |
| Updates the statistic given the current observation and returns the current value of this statistic. | |
Static Public Member Functions | |
| static StatisticHandleRef | make_statistic (agx::Real maxSmoothingFactor, agx::Real initialObservation=0) |
Protected Attributes | |
| agx::Real | m_s |
| agx::Real | m_smoothFactor |
Exponential moving average statistic.
At observation \(Y_n\) the statistic \(S_n\) is calculated as: \(S_n = S_{n-1} + \alpha \left( Y_n - S_{n-1} \right)\), where \( 0 < \alpha < 1\) is the smoothing factor.
Definition at line 93 of file Statistic.h.
|
inline |
| smoothFactor | - the smoothing factor used to propagate the average (must be between zero and one) |
| initialObservation | - initial observation, default zero (optional) |
Definition at line 100 of file Statistic.h.
|
inlinevirtual |
Definition at line 128 of file Statistic.h.
|
inlinevirtual |
Implements agxUtil::Statistic.
Definition at line 116 of file Statistic.h.
|
inline |
Definition at line 121 of file Statistic.h.
|
inlinestatic |
Definition at line 130 of file Statistic.h.
|
inline |
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.
Definition at line 114 of file Statistic.h.
|
inline |
| smoothFactor | - the smoothing factor |
Definition at line 126 of file Statistic.h.
|
inlinevirtual |
Updates the statistic given the current observation and returns the current value of this statistic.
| observation | - the current observation |
Implements agxUtil::Statistic.
Reimplemented in agxUtil::VariableSmoothFactorEMAStatistic.
Definition at line 103 of file Statistic.h.
|
protected |
Definition at line 139 of file Statistic.h.
|
protected |
Definition at line 138 of file Statistic.h.