Set the discount coefficient for this moving average. It may be useful to adjust this value if, for example, the average waiting time between data points turns out to be very different from initial expectations.
Calculates the predicted future value of the moving average
Generates an updated moving average with a new data point, using the specified discount coefficient. The new moving average is returned as a new struct instance, rather than mutating the internal struct data.
"Constructor"-style static opCall
type used to indicate the observation time of individual data values; may be any type implicitly convertible to time_t, or any integral or floating point value
floating-point type used to indicate data values
The double-exponential moving average implemented here is derived from section 3 (eqs. 16-22) of Cipra, T. (2006) 'Exponential smoothing for irregular data', Applications of Mathematics 51 (6): 597-604 <http://dml.cz/handle/10338.dmlcz/134655>.
Most of the parameter names are derived from their counterparts in the aforementioned article.
Moving average designed to handle irregularly spaced data, i.e. data where the time intervals between successive values are not the same.