Dimensionality reduction for time series data