Ckmeans.1d.dp: Optimal and Fast Univariate Clustering

Fast optimal univariate clustering and segementation by dynamic programming. Three types of problem including univariate k-means, k-median, and k-segments are solved with guaranteed optimality and reproducibility. The core algorithm minimizes the sum of within-cluster distances using respective metrics. Its advantage over heuristic clustering algorithms in efficiency and accuracy is increasingly pronounced as the number of clusters k increases. Weighted k-means and unweighted k-segments algorithms can also optimally segment time series and perform peak calling. An auxiliary function generates histograms that are adaptive to patterns in data. In contrast to heuristic methods, this package provides a powerful set of tools for univariate data analysis with guaranteed optimality.

Version: 4.2.1
Depends: R (≥ 2.10.0)
Suggests: testthat, knitr, rmarkdown
Published: 2017-07-09
Author: Joe Song [aut, cre], Haizhou Wang [aut]
Maintainer: Joe Song <joemsong at>
License: LGPL (≥ 3)
NeedsCompilation: yes
Citation: Ckmeans.1d.dp citation info
Materials: NEWS
CRAN checks: Ckmeans.1d.dp results


Reference manual: Ckmeans.1d.dp.pdf
Vignettes: Tutorial: Optimal univariate clustering
Tutorial: Linear weight scaling in cluster analysis
Tutorial: Adaptive versus regular histograms
Package source: Ckmeans.1d.dp_4.2.1.tar.gz
Windows binaries: r-devel:, r-release:, r-oldrel:
OS X El Capitan binaries: r-release: Ckmeans.1d.dp_4.2.1.tgz
OS X Mavericks binaries: r-oldrel: Ckmeans.1d.dp_4.2.1.tgz
Old sources: Ckmeans.1d.dp archive

Reverse dependencies:

Reverse imports: gsrc, Tnseq
Reverse suggests: FunChisq, xgboost


Please use the canonical form to link to this page.