Package longclust. March 18, 2018

Similar documents
Package sensory. R topics documented: February 23, Type Package

Package glassomix. May 30, 2013

Package FisherEM. February 19, 2015

Package FPDclustering

Package clustvarsel. April 9, 2018

Package flexcwm. May 20, 2018

Package ECctmc. May 1, 2018

Package cwm. R topics documented: February 19, 2015

Package manet. September 19, 2017

Package datasets.load

Package mrm. December 27, 2016

Package gppm. July 5, 2018

Package RidgeClust. January 18, 2011

Package RCA. R topics documented: February 29, 2016

Package clustering.sc.dp

Package ccapp. March 7, 2016

Package bisect. April 16, 2018

Package mixphm. July 23, 2015

Package Numero. November 24, 2018

Package frequencyconnectedness

Package FMsmsnReg. March 30, 2016

Package MixSim. April 29, 2017

Package TVsMiss. April 5, 2018

Package strat. November 23, 2016

Package rpst. June 6, 2017

Package comphclust. May 4, 2017

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package pwrrasch. R topics documented: September 28, Type Package

Package weco. May 4, 2018

Package Rambo. February 19, 2015

Package gridgraphics

Package tidylpa. March 28, 2018

Package BigVAR. R topics documented: April 3, Type Package

Package longitudinal

Package gibbs.met. February 19, 2015

Package ConvergenceClubs

Package ASICS. January 23, 2018

Package manet. August 23, 2018

Package lgarch. September 15, 2015

Package CatEncoders. March 8, 2017

Package clustmd. May 8, 2017

Package ICSOutlier. February 3, 2018

Package optimus. March 24, 2017

Package freeknotsplines

Package simsurv. May 18, 2018

Package corclass. R topics documented: January 20, 2016

Package RNAseqNet. May 16, 2017

Package semisup. March 10, Version Title Semi-Supervised Mixture Model

Package esabcv. May 29, 2015

Package DCEM. September 30, 2018

Package mlvar. August 26, 2018

Package mtsdi. January 23, 2018

Package MmgraphR. R topics documented: September 14, Type Package

Package spark. July 21, 2017

Package glmmml. R topics documented: March 25, Encoding UTF-8 Version Date Title Generalized Linear Models with Clustering

Package QCAtools. January 3, 2017

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package penalizedlda

Package FWDselect. December 19, 2015

Package gtrendsr. October 19, 2017

Package geneslope. October 26, 2016

Package mlegp. April 15, 2018

Package permuco. February 14, Type Package

Package gtrendsr. August 4, 2018

Package ETC. February 19, 2015

Package apastyle. March 29, 2017

Package RPMM. August 10, 2010

Package GenSA. R topics documented: January 17, Type Package Title Generalized Simulated Annealing Version 1.1.

Package deductive. June 2, 2017

Package Rsomoclu. January 3, 2019

Package fastdummies. January 8, 2018

Package sigqc. June 13, 2018

Package sspse. August 26, 2018

Package RPMM. September 14, 2014

Package listdtr. November 29, 2016

Package svalues. July 15, 2018

Package simr. April 30, 2018

Package NetCluster. R topics documented: February 19, Type Package Version 0.2 Date Title Clustering for networks

Package bayesdp. July 10, 2018

Package modmarg. R topics documented:

Package mvprobit. November 2, 2015

Package OLScurve. August 29, 2016

Package egonet. February 19, 2015

Package abe. October 30, 2017

Package CuCubes. December 9, 2016

Package ordinalclust

Package SSRA. August 22, 2016

Package sfc. August 29, 2016

Package ClusterBootstrap

Package PTE. October 10, 2017

Package exporkit. R topics documented: May 5, Type Package Title Expokit in R Version Date

Package clusternomics

Package sglasso. May 26, 2018

Package ManlyMix. November 19, 2017

Package rfsa. R topics documented: January 10, Type Package

Package areaplot. October 18, 2017

Package ecoseries. R topics documented: September 27, 2017

Package BinNor. February 10, 2018

Package subplex. April 5, 2018

Package rknn. June 9, 2015

Transcription:

Package longclust March 18, 2018 Type Package Title Model-Based Clustering and Classification for Longitudinal Data Version 1.2.2 Date 2018-03-18 Author Paul D. McNicholas [aut, cre], K. Raju Jampani [aut] (May to Dec 2012), Sanjeena Subedi [aut] Maintainer Paul D. McNicholas <mcnicholas@math.mcmaster.ca> Suggests mvtnorm Clustering or classification of longitudinal data based on a mixture of multivariate t or Gaussian distributions with a Cholesky-decomposed covariance structure. License GPL (>= 2) LazyLoad yes Repository CRAN NeedsCompilation yes Date/Publication 2018-03-18 21:30:18 UTC R topics documented: longclust-package...................................... 2 longclustem......................................... 2 plot.longclust........................................ 4 print.longclust........................................ 5 summary.longclust..................................... 6 Index 8 1

2 longclustem longclust-package Model-Based Clustering and Classification for Longitudinal Data Details This is a package for clustering or classification of longitudinal data based on a mixture of multivariate t or Gaussian distributions with a Cholesky-decomposed covariance structure. Package: longclust Type: Package Version: 1.2.2 Date: 2018-03-18 License: GPL-2 or GPL-3 LazyLoad: yes This package contains the function longclustem. P. D. McNicholas, K.R. Jampani and S. Subedi Maintainer: Paul McNicholas <mcnicholas@math.mcmaster.ca> See Also Details, examples, and references are given under longclustem. longclustem Model-Based Clustering and Classification for Longitudinal Data Carries out model-based clustering or classification using multivariate t or Gaussian mixture models with Cholesky decomposed covariance structure. EM algorithms are used for parameter estimation and the BIC is used for model selection. Usage longclustem(x, Gmin, Gmax, class=null, linearmeans = FALSE, modelsubset = NULL, initwithkmeans = FALSE, criteria = "BIC", equaldf = FALSE, gaussian=false, userseed=1004)

longclustem 3 Arguments x A matrix or data frame such that rows correspond to observations and columns correspond to variables. Gmin A number giving the minimum number of components to be used. Gmax A number giving the maximum number of components to be used. class If NULL then model-based clustering is performed. If a vector with length equal to the number of observations, then model-based classification is performed. In this latter case, the ith entry of class is either zero, indicating that the component membership of observation i is unknown, or it corresponds to the component membership of observation i. linearmeans If TRUE, then means are modelled using linear models. modelsubset A vector of strings giving the models to be used. If set to NULL, all models are used. initwithkmeans If TRUE, the components are initialized using k-means algorithm. criteria A string that denotes the criteria used for evaluating the models. Its value should be "BIC" or "ICL". equaldf If TRUE, the degrees of freedom of all the components will be the same. gaussian If TRUE, a mixture of Gaussian distributions is used in place of a mixture of t-distributions. userseed The random number seed to be used. Value Gbest zbest nubest mubest Tbest Dbest The number of components for the best model. A matrix that gives the probabilities for any data element to belong to any component in the best model. A vector of Gbest integers, that give the degrees of freedom for each component in the best model. A matrix containing the means of the components for the best model (one per row). A list of Gbest matrices, giving the T matrices of the components for the best model. A list of Gbest matrices, giving the D matrices of the components for the best model. Paul D. McNicholas, K. Raju Jampani and Sanjeena Subedi References Paul D. McNicholas and T. Brendan Murphy (2010). Model-based clustering of longitudinal data. The Canadian Journal of Statistics 38(1), 153-168. Paul D. McNicholas and Sanjeena Subedi (2012). Clustering gene expression time course data using mixtures of multivariate t-distributions. Journal of Statistical Planning and Inference 142(5), 1114-1127.

4 plot.longclust Examples library(mvtnorm) m1 <- c(23,34,39,45,51,56) S1 <- matrix(c(1.00, -0.90, 0.18, -0.13, 0.10, -0.05, -0.90, 1.31, -0.26, 0.18, -0.15, 0.07, 0.18, -0.26, 4.05, -2.84, 2.27, -1.13, -0.13, 0.18, -2.84, 2.29, -1.83, 0.91, 0.10, -0.15, 2.27, -1.83, 3.46, -1.73, -0.05, 0.07, -1.13, 0.91, -1.73, 1.57), 6, 6) m2 <- c(16,18,15,17,21,17) S2 <- matrix(c(1.00, 0.00, -0.50, -0.20, -0.20, 0.19, 0.00, 2.00, 0.00, -1.20, -0.80, -0.36,-0.50, 0.00, 1.25, 0.10, -0.10, -0.39, -0.20, -1.20, 0.10, 2.76, 0.52, -1.22,-0.20, -0.80, -0.10, 0.52, 1.40, 0.17, 0.19, -0.36, -0.39, -1.22, 0.17, 3.17), 6, 6) m3 <- c(8, 11, 16, 22, 25, 28) S3 <- matrix(c(1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, -0.20, -0.64, 0.26, 0.00, 0.00, -0.20, 1.04, -0.17, -0.10, 0.00, 0.00, -0.64, -0.17, 1.50, -0.65, 0.00, 0.00, 0.26, -0.10, -0.65, 1.32, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00), 6, 6) m4 <- c(12, 9, 8, 5, 4,2) S4 <- diag(c(1,1,1,1,1,1)) data <- matrix(0, 40, 6) data[1:10,] <- rmvnorm(10, m1, S1) data[11:20,] <- rmvnorm(10, m2, S2) data[21:30,] <- rmvnorm(10, m3, S3) data[31:40,] <- rmvnorm(10, m4, S4) clus <- longclustem(data, 3, 5, linearmeans=true) summary(clus) plot(clus,data) plot.longclust Plots the components of the model. Usage Displays a series of two plots, one containing all the components in different colors, and one containing subplots one per each component. ## S3 method for class 'longclust' plot(x, data,...) Arguments x data... Default arguments. An object of type longclust returned by longclustem. The data matrix used in computing clus.

print.longclust 5 Paul D. McNicholas, K. Raju Jampani and Sanjeena Subedi Examples library(mvtnorm) m1 <- c(23,34,39,45,51,56) S1 <- matrix(c(1.00, -0.90, 0.18, -0.13, 0.10, -0.05, -0.90, 1.31, -0.26, 0.18, -0.15, 0.07, 0.18, -0.26, 4.05, -2.84, 2.27, -1.13, -0.13, 0.18, -2.84, 2.29, -1.83, 0.91, 0.10, -0.15, 2.27, -1.83, 3.46, -1.73, -0.05, 0.07, -1.13, 0.91, -1.73, 1.57), 6, 6) m2 <- c(16,18,15,17,21,17) S2 <- matrix(c(1.00, 0.00, -0.50, -0.20, -0.20, 0.19, 0.00, 2.00, 0.00, -1.20, -0.80, -0.36,-0.50, 0.00, 1.25, 0.10, -0.10, -0.39, -0.20, -1.20, 0.10, 2.76, 0.52, -1.22,-0.20, -0.80, -0.10, 0.52, 1.40, 0.17, 0.19, -0.36, -0.39, -1.22, 0.17, 3.17), 6, 6) m3 <- c(8, 11, 16, 22, 25, 28) S3 <- matrix(c(1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, -0.20, -0.64, 0.26, 0.00, 0.00, -0.20, 1.04, -0.17, -0.10, 0.00, 0.00, -0.64, -0.17, 1.50, -0.65, 0.00, 0.00, 0.26, -0.10, -0.65, 1.32, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00), 6, 6) m4 <- c(12, 9, 8, 5, 4,2) S4 <- diag(c(1,1,1,1,1,1)) data <- matrix(0, 40, 6) data[1:10,] <- rmvnorm(10, m1, S1) data[11:20,] <- rmvnorm(10, m2, S2) data[21:30,] <- rmvnorm(10, m3, S3) data[31:40,] <- rmvnorm(10, m4, S4) clus <- longclustem(data, 3, 5, linearmeans=true) plot(clus,data) print.longclust Brief overview of the longclust object Prints the number of components, probabily matrix, degrees of freedom and the component means of the computed best model. Usage ## S3 method for class 'longclust' print(x,...) Arguments x An object of type longclust, computed by longclustem.... Default Arguments

6 summary.longclust Paul D. McNicholas, K. Raju Jampani and Sanjeena Subedi Examples library(mvtnorm) m1 <- c(23,34,39,45,51,56) S1 <- matrix(c(1.00, -0.90, 0.18, -0.13, 0.10, -0.05, -0.90, 1.31, -0.26, 0.18, -0.15, 0.07, 0.18, -0.26, 4.05, -2.84, 2.27, -1.13, -0.13, 0.18, -2.84, 2.29, -1.83, 0.91, 0.10, -0.15, 2.27, -1.83, 3.46, -1.73, -0.05, 0.07, -1.13, 0.91, -1.73, 1.57), 6, 6) m2 <- c(16,18,15,17,21,17) S2 <- matrix(c(1.00, 0.00, -0.50, -0.20, -0.20, 0.19, 0.00, 2.00, 0.00, -1.20, -0.80, -0.36,-0.50, 0.00, 1.25, 0.10, -0.10, -0.39, -0.20, -1.20, 0.10, 2.76, 0.52, -1.22,-0.20, -0.80, -0.10, 0.52, 1.40, 0.17, 0.19, -0.36, -0.39, -1.22, 0.17, 3.17), 6, 6) m3 <- c(8, 11, 16, 22, 25, 28) S3 <- matrix(c(1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, -0.20, -0.64, 0.26, 0.00, 0.00, -0.20, 1.04, -0.17, -0.10, 0.00, 0.00, -0.64, -0.17, 1.50, -0.65, 0.00, 0.00, 0.26, -0.10, -0.65, 1.32, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00), 6, 6) m4 <- c(12, 9, 8, 5, 4,2) S4 <- diag(c(1,1,1,1,1,1)) data <- matrix(0, 40, 6) data[1:10,] <- rmvnorm(10, m1, S1) data[11:20,] <- rmvnorm(10, m2, S2) data[21:30,] <- rmvnorm(10, m3, S3) data[31:40,] <- rmvnorm(10, m4, S4) clus <- longclustem(data, 3, 5, linearmeans=true) print(clus) ## The function is currently defined as function (tch,...) { cat("number of Clusters:", tch$gbest, "\n") cat("z:\n") print(tch$zbest) cat("\n") for (g in 1:tch$Gbest) { cat("cluster: ", g, "\n") cat("v: ", tch$nubest[g], "\n") cat("mean:", tch$mubest[g, ], "\n\n") } } summary.longclust Summary of the longclust object

summary.longclust 7 Usage Prints all the items in the object. ## S3 method for class 'longclust' summary(object,...) Arguments object... Default arguments. An object of type longclust, returned by longclustem. Paul D. McNicholas, K. R. Jampani and Sanjeena Subedi Examples library(mvtnorm) m1 <- c(23,34,39,45,51,56) S1 <- matrix(c(1.00, -0.90, 0.18, -0.13, 0.10, -0.05, -0.90, 1.31, -0.26, 0.18, -0.15, 0.07, 0.18, -0.26, 4.05, -2.84, 2.27, -1.13, -0.13, 0.18, -2.84, 2.29, -1.83, 0.91, 0.10, -0.15, 2.27, -1.83, 3.46, -1.73, -0.05, 0.07, -1.13, 0.91, -1.73, 1.57), 6, 6) m2 <- c(16,18,15,17,21,17) S2 <- matrix(c(1.00, 0.00, -0.50, -0.20, -0.20, 0.19, 0.00, 2.00, 0.00, -1.20, -0.80, -0.36,-0.50, 0.00, 1.25, 0.10, -0.10, -0.39, -0.20, -1.20, 0.10, 2.76, 0.52, -1.22,-0.20, -0.80, -0.10, 0.52, 1.40, 0.17, 0.19, -0.36, -0.39, -1.22, 0.17, 3.17), 6, 6) m3 <- c(8, 11, 16, 22, 25, 28) S3 <- matrix(c(1.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00, -0.20, -0.64, 0.26, 0.00, 0.00, -0.20, 1.04, -0.17, -0.10, 0.00, 0.00, -0.64, -0.17, 1.50, -0.65, 0.00, 0.00, 0.26, -0.10, -0.65, 1.32, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.00), 6, 6) m4 <- c(12, 9, 8, 5, 4,2) S4 <- diag(c(1,1,1,1,1,1)) data <- matrix(0, 40, 6) data[1:10,] <- rmvnorm(10, m1, S1) data[11:20,] <- rmvnorm(10, m2, S2) data[21:30,] <- rmvnorm(10, m3, S3) data[31:40,] <- rmvnorm(10, m4, S4) clus <- longclustem(data, 3, 5, linearmeans=true) summary(clus)

Index longclust (longclust-package), 2 longclust-package, 2 longclustem, 2, 2 plot.longclust, 4 print.longclust, 5 summary.longclust, 6 8