KmlShape is a package design to cluster longitudinal data according to their shape.
Details
Package:
KmlShape
Type:
Package
Version:
0.9.5
Date:
2016-03-04
License:
GPL >2.0
kmlShape cluster longitudinal data according to their shape: instead of
merging individual whose trajectories are closed in term of euclidienne
distance, it groups the individual that are closed according Frechet's
distance.
Since k-means using Frechet has a complexity in O(n^2t^2), KmlShape also
provide some function to reduce the size of the data without changing
the result:
reduceNbId reduce the number of individual, by
merging them using a classical k-means on many centers.
reduceNbTimes reduce the number of measurement, by
(optionaly) smoothing the curve then by applying the Douglas-Peuker
algorithms.
#########
### Real example, on ictus data
### Preparing the data
set.seed(1)
data(ictusShort)
myClds <- cldsWide(ictusShort)
### Reducing the data size
reduceTraj(myClds,nbSenators=64,nbTimes=5)
### Clustering using shape
kmlShape(myClds,4)
plotMeans(myClds)