I am trying to perform a Time Series Clustering With Dynamic Time Warping Distance (DTW) with the dtwclust
package.
I use this function,
dtwclust(data = NULL, type = "partitional", k = 2L, method = "average",
distance = "dtw", centroid = "pam", preproc = NULL, dc = NULL,
control = NULL, seed = NULL, distmat = NULL, ...)
I save my data as a list, they have different length. like the example below, and it is a time series.
$a
[1] 0 0 0 0 2 3 6 7 8 9 11 13
$b
[1] 0 1 1 2 4 7 8 11 13 15 17 19 22 25 28 31 34 35
$c
[1] 1 2 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 7 7 8 8 9 10 10 12 14 15 17 19
$d
[1] 0 0 0 0 0 1 2 4 4 4
$e
[1] 0 1 1 3 5 6 9 12 14 17 19 20 22 24 28 31 32 34
Now, my problem are
(1)
I can only choose dtw
, dtw2
or sbd
for my distance and dba
, shape
or pam
for my centroid (because of different length of list). But, I don't know which distance and centroid is correct.
(2) I have plot some graphs, but I don't know how to choose the right and reasonable one.
k = 6, distance = dtw, centroid = dba
:
k = 4, distance = dtw, centroid = dba
(the cluster center seems wired?)
I have do all the combination, k from 4 to 13... but I have no idea about how to choose the right one...