Exponentially-weighted moving average (Ewma) solved using iteration. Given scalar ‘alpha’ (between 0 and 1) and vector ‘X’, this template solves for L, such that:
L(t) = (alpha*X) + (1-alpha)*L(t-1) L(1) = X(1)
It solves this by looping through all the cases and appending the results.