template<typename F, typename T, typename I = unsigned long>
struct ExponentialRollAdopter;
|
This functor applies functor F to the data in an exponentially decaying rolling progression. The roll count is given to the constructor of ExponentialRollAdopter. The other parameters to the constructor determine how the decay is calculated. Please see the exponential_decay_spec type above.
The result is a vector of values with same number of items as the given column. The first roll_count items, in the result, will be NAN.
The formula used is: (decay * Xt) + ((1 − decay) * Yt-1)
Where:
Xt is current value
Yt-1 is last calculated stats
inline ExponentialRollAdopter(F &&functor, size_t roll_count, exponential_decay_spec eds, double value)
|
F: Functor type
T: Column data type
I: Index type
|