Dynamic clustering of time series data