Clustering Longitudinal Trajectories

Clusters longitudinal trajectories over time (can be unequally spaced, unequal length time series and/or partially overlapping series) on a common time axis. Performs k-means clustering on a single continuous variable measured over time, where each mean is defined by a thin plate spline fit to all points in a cluster. Distance is MSE across trajectory points to cluster spline. Provides graphs of derived cluster splines, silhouette plots, and Adjusted Rand Index evaluations of the number of clusters. Scales well to large data with multicore parallelism available to speed computation.


A package for clustering longitudinal trajectories

Clusters trajectories (unequally spaced and unequal length time series) on a common time axis. Clustering proceeds by an EM algorithm that iterates switching between fitting a thin plate spline (TPS) to combined responses within each cluster (M-step) and reassigning cluster membership based on the nearest fitted TPS (E-step). Initial cluster assignments are random or distant trajectories. The fitting is done with the mgcv package function bam, which scales well to very large data sets. Additional parallelism available via multicore on unix and mac platforms.

See the vignettes for detailed use examples.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("clustra")

0.2.1 by George Ostrouchov, 3 years ago


Browse source code at https://github.com/cran/clustra


Authors: George Ostrouchov [aut, cre] , David Gagnon [aut] , Hanna Gerlovin [aut] , Chen Wei-Chen [ctb] , Schmidt Drew [ctb] , Oak Ridge National Laboratory [cph] , U.S. Department of Veteran's Affairs [fnd] (Project: Million Veteran Program Data Core)


Documentation:   PDF Manual  


BSD 2-clause License + file LICENSE license


Imports data.table, graphics, grDevices, methods, mgcv, MixSim, parallel, stats

Suggests haven, knitr, rmarkdown


See at CRAN