6
$\begingroup$

I'm doing clustering on time-series (each time-series has the information for one day = 24 hours). For the clustering purpose, it's important for me to consider the time period in which the shape of time-series is different from the baseline. So, I'm looking for an appropriate distance metric.

For example, let's consider these 4 time-series, and I want to cluster them into two groups.

enter image description here

Apperaently, for k=2, time-series 1 and 2 are more similar and considered as one cluster and time-series 3 and 4 are inside another cluster. However, when I use the commonly used Euclidean distance metric, the calculated distance between all time-series is the same since it considers one to one mapping between points, and does not account for how far these shapes are. I have tried Dynamic Time Warping (DTW) as well since its application matches what I want to do here, but my clustering results in a larger-scale dataset are even less promising compared to what Euclidean distance obtains (I'm using the default MATLAB command line for DTW, so I'm not sure if I'm utilizing it efficiently).

My question is what distance metric is more appropriate to capture the similarity in this case.

$\endgroup$
  • $\begingroup$ Are 1 and 4 in one cluster because they occur during the night/dark? (Wraparound) $\endgroup$ – Rob Jul 19 '18 at 16:34
  • 1
    $\begingroup$ That's an interesting point you brought up! But at this time I'm considering each time-series as 24 points (starting from 1 to 24) and just looking for a metric that shows me the distance between #4 and #3 is lower compared to #4 and #2 or #4 and #1 based on visual intuition. $\endgroup$ – N.researcher Jul 19 '18 at 17:07
  • 1
    $\begingroup$ Have you checked the dtwclust package - github.com/asardaes/dtwclust $\endgroup$ – Nishad Jul 20 '18 at 23:38
  • $\begingroup$ How about the integral of t * f(t) $\endgroup$ – Rohit Chatterjee Jul 21 '18 at 12:57
  • 1
    $\begingroup$ (Or in your case, sum(n * f(n)), n ranging from 1 to 24) $\endgroup$ – Rohit Chatterjee Jul 21 '18 at 13:06
3
$\begingroup$

Minor point, DTW is not a metric, just a measure.

The measure you need is constrained DTW (or cDTW),

With enough data you can learn the constraint, but here is it clear it should be about 1/3 the length of the time series.

This tutorial will tell you all you need to know http://www.cs.unm.edu/~mueen/DTW.pdf

eamonn

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.