A similarity measure for multivariate time series