Learn R Programming

vows (version 0.2-0)

funkmeans: Functional k-means clustering for parallel smooths

Description

This function performs k-means clustering for curve estimates corresponding to each of a 3D grid of points. For example, when scatterplot smoothing is performed at each of a grid of brain voxels as in Reiss et al. (2013), this function can be used to cluster the obtained smooths.

Usage

funkmeans(obj, which.smooth = 1, deriv = 1, lambda = 0, ncomp, centers, nstart = 10)

Arguments

obj
a "massively parallel" semiparametric model object, of class semipar.mp.
which.smooth
which of the smooth terms to use for functional k-means: e.g., if obj consists of fits of the model ~ sf(x1) + sf(x2), which.smooth = 2 yields k-means clustering for the curves with respect to x2. The de
deriv
which derivative of the curves should be clustered. If 0, the curves themselves are clustered; if 1 (the default), their first derivatives are clustered, a natural way to assign curves of similar shape to the same cluster.
lambda
smoothing parameter for functional PCA as implemented by pca.fd.
ncomp
number of functional principal components.
centers
number of clusters.
nstart
number of randomly chosen sets of initial centers used by the kmeans function.

Value

  • An object of class "funkmeans", which is a list with elements:
  • cluster, centers, withinss, tots, tot.withinss, betweenness, sizesee kmeans.
  • basis,coefbasis object and coefficient matrix defining the functional data object (see fd) for the curves that are clustered.
  • fpcafunctional principal components object, output by pca.fd.
  • R2proportion of variance explained by the k clusters.
  • which.smoothvalue of argument which.smooth in the function call.

Details

The functional clustering algorithm consists of performing (i) functional principal component analysis of the curve estimates or their derivatives, followed by (ii) k-means clustering of the functional PC scores (Tarpey and Kinateder, 2003).

References

Reiss, P. T., Huang, L., Chen, Y.-H., Huo, L., Tarpey, T., and Mennes, M. (2013). Massively parallel nonparametric regression, with an application to developmental brain mapping. Journal of Computational and Graphical Statistics, to appear. Available at http://works.bepress.com/phil_reiss/24 Tarpey, T., and Kinateder, K. K. J. (2003). Clustering functional data. Journal of Classification, 20, 93--114.

See Also

funkmeans4d, funkpanel

Examples

Run this code
# See example for funkpanel

Run the code above in your browser using DataLab