Exponential Smoothing in Scala