Learn R Programming

kml3d (version 0.7)

parKml: ~ Function: parKml ~

Description

parKml is the constructor of object ParKml.

Usage

parKml(saveFreq = 100, maxIt = 200, imputationMethod = "LI-Bissectrice", distanceName = "euclidean", power = 2, distance = function() {
}, centerMethod = meanNA, startingCond = "allMethods", distanceStartingCond = function(x, y) dist(rbind(x, y)), nbCriterion = 100)

Arguments

saveFreq
[numeric]: Long computations can take several days. So it is possible to save the object ClusterLongData on which works kml3d once in a while.
maxIt
[numeric]: Set a limit to the number of iteration if convergence is not reached.
imputationMethod
[character]: the calculation of quality criterion can not be done if some value are missing. imputationMethod define the method use to impute the missing value. It should be one of "LI-Bissectrice" (the default)
distanceName
[character]: name of the distance used by k-means. If the distanceName is one of "manhattan", "euclidean", "minkowski", "maximum", "canberra" or "binary", a compiled optimized version specificaly desig
power
[numeric]: If distanceName="minkowski", this define the power that will be used.
distance
[numeric <- function(trajA,trajB)]: function that computes the distance between two trajectories. If no function is specified, the Euclidian distance with Gower adjustment (to deal with missing value) is used.
centerMethod
[numeric <- function(vector(numeric))]: k-means algorithm computes the centers of each cluster. It is possible to personalize the definition of "center" by defining a function "centerMethod". This function should take a
startingCond
[character]: specifies the starting condition. Should be one of "maxDist", "randomAll", "randomK" or "allMethods". See partitionInitialise for details.
distanceStartingCond
[numeric <- function(trajA,trajB)]: some starting condition needs to compute the distance matrix of the trajectories. distanceStartingCond define the distance that will be use to calculate this matrix. See
nbCriterion
[numeric]: set the maximum number of quality criterion that are display on the graph (since displaying a high criterion number an slow down the overall process, the default value is 100).

Value

  • An object ParKml.

Author(s)

Christophe Genolini INSERM U669 / PSIGIAM: Paris Sud Innovation Group in Adolescent Mental Health Modal'X / Universite Paris Ouest-Nanterre- La Defense Contact author : genolini@u-paris10.fr

Details

parKml is the constructor of object ParKml.

References

Article "KmL: K-means for Longitudinal Data", in Computational Statistics, Volume 25, Issue 2 (2010), Page 317. Web site: http://christophe.genolini.free.fr/kml

Examples

Run this code
### Generation of some data
cld1 <- generateArtificialLongData(c(15,15,15))

### Setting two different set of option :
(option1 <- parKml())
(option2 <- parKml(distanceName="maximum",centerMethod=function(x)median(x,na.rm=TRUE)))

### Running kml3d We suspect 2, 3, 4 or 5 clusters, we want 3 redrawing.
kml3d(cld1,4,1,toPlot="both",paramKml=option1)
kml3d(cld1,4,1,toPlot="both",paramKml=option2)

Run the code above in your browser using DataLab