Closed Wang-Yu-Qing closed 8 years ago
The fuzzy clustering algorithm that's implemented is fuzzy c-means. Technically, you can change the distance function, but the centroid function does not change. Actually, c@centroid
should contain fcm
, since it overrides any user-provided arguments. The error you're getting with k=2
is indeed a problem in the code, I'll fix it.
I'm not too familiar with fuzzy clustering, but at least in what I've read, people usually don't cluster time series directly, but use some kind of transformation first. The centroid function used by fuzzy c-means is like a weighted average, and I'm not sure it could be changed without altering the clustering algorithm significantly.
When use centroid calculation of ''pam'', the centers of each cluster are supposed to be one of those series in the cluster. However, when I tested this:
The centers are seemly means of the clusters rather than one of the series. Additionally, when I tried
k=2
inc<-dtwclust(a,'fuzzy',k=2,distance = 'dtw','pam',seed=100)
, the response isError in apply(cluster[, -1L], 1L, sum) : dim(X) must have a positive length
. I don't understand why these happen.