Learn R Programming

vows (version 0.5)

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. (2014), this function can be used to cluster the obtained smooths.

Usage

funkmeans(fdobj, deriv = 1, lambda = 0, ncomp, centers, nstart = 10, store.fdobj = TRUE)

Arguments

fdobj
a functional data object, of class "fd", defining the set of curves being clustered.
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.
store.fdobj
logical: Should the input fd object be stored in the output? May wish to set to FALSE for large sets of smooths.

Value

An object of class "funkmeans", which is a list with elements: An object of class "funkmeans", which is a list with elements:

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

Alexander-Bloch, A. F., Reiss, P. T., Rapoport, J., McAdams, H., Giedd, J. N., Bullmore, E. T., and Gogtay, N. (2014). Abnormal cortical growth in schizophrenia targets normative modules of synchronized development. Biological Psychiatry, in press.

Reiss, P. T., Huang, L., Chen, Y.-H., Huo, L., Tarpey, T., and Mennes, M. (2014). Massively parallel nonparametric regression, with an application to developmental brain mapping. Journal of Computational and Graphical Statistics, Journal of Computational and Graphical Statistics, 23(1), 232--248.

Tarpey, T., and Kinateder, K. K. J. (2003). Clustering functional data. Journal of Classification, 20, 93--114.

See Also

funkmeans4d

Examples

Run this code

data(test)
d4 = test$d4
x = test$x
semi.obj = semipar4d(d4, ~sf(x), -5:5, data.frame(x = x))
fdobj = extract.fd(semi.obj)
fkmobj = funkmeans4d(fdobj, d4, ncomp=6, centers=3)

Run the code above in your browser using DataLab