Learn R Programming

funHDDC (version 1.0)

funHDDC: Model-based clustering in group-specific functional subspaces

Description

It provides the funHDDC algorithm (Bouveyron & Jacques, 2011) which allows to cluster functional data by modeling each group within a specific functional subspace.

Usage

funHDDC(fd, K, init = "hclust", model = "AkBkQkDk", thd = 0.05, maxit = 50,
	 eps = 1e-6, ...)

Arguments

fd

a functional data object produced by the fda package.

K

the number of clusters.

init

the initialization type ('random', 'kmeans' of 'hclust'). 'hclust' is the default.

model

the chosen model among 'AkjBkQkDk', 'AkjBQkDk','AkBkQkDk','AkBQkDk','ABkQkDk','ABQkDk'. See (Bouveyron & Jacques, 2011) for details.

thd

the threshold of the Cattell' scree-test used for selecting the group-specific initrisic dimensions. See (Bouveyron & Jacques, 2011) for details.

maxit

the maximum number of iterations.

eps

the threshold of the convergence criterion.

additional options for internal functions.

Value

cls

the clustering partition

P

the posterior probablities

prms

the model parameters

bic

the BIC value

aic

the AIC value

icl

the ICL value

loglik

vector of the log-likelhood values

References

C. Bouveyron & J. Jacques, Model-based Clustering of Time Series in Group-specific Functional Subspaces, Advances in Data Analysis and Classification, vol. 5 (4), pp. 281-300, 2011.

Examples

Run this code
# NOT RUN {
# Clustering the well-known "Canadian temperature" data (Ramsay & Silverman)
basis <- create.bspline.basis(c(0, 365), nbasis=21, norder=4)
fdobj <- smooth.basis(day.5, CanadianWeather$dailyAv[,,"Temperature.C"],basis,
  fdnames=list("Day", "Station", "Deg C"))$fd
res = funHDDC(fdobj,4,model='AkBQkDk',init='hclust',thd=0.001)

# Visualization of the partition and the group means
par(mfrow=c(1,2))
plot(fdobj,col=res$cls,lwd=2,lty=1)
fdmeans = fdobj; fdmeans$coefs = t(res$prms$m)
plot(fdmeans,col=1:max(res$cls),lwd=2)

## DO NOT RUN
# # Map of the results
# par(mfrow=c(1,12))
# library(maps)
# map("world", "canada")
# text(-CanadianWeather$coordinates[,2],CanadianWeather$coordinates[,1],
#      labels=rownames(CanadianWeather$coordinates),col=res$cls,cex=0.75)
# }

Run the code above in your browser using DataLab