Scala time-series classes and functions