Learn R Programming

kml (version 2.4.6.1)

calculTrajFuzzyMean: ~ Function: calculTrajFuzzyMean ~

Description

Given some longitudinal data and a group's membership, calculFuzzyMean computes the mean trajectories of each cluster.

Usage

calculTrajFuzzyMean(traj, fuzzyClust)

Value

A matrix with k line and t column containing k clusters centers. Each line is a center, each column is a time measurement.

Arguments

traj

[matrix]: longitudinal data. Each line is an individual, each column is a time measurement.

fuzzyClust

[matrix(numeric)]: membership matrix of each individual.

Details

Given a matrix of individual membership, the function calculTrajFuzzyMean compute the mean trajectory of each clusters.

affectFuzzyIndiv used with calculTrajFuzzyMean simulates one fuzzy k-means step.

Examples

Run this code
#######################
### calculTrajFuzzyMean

### Some LongitudinalData
traj <- gald()["traj"]

### 4 clusters centers
center <- traj[runif(4,1,nrow(traj)),]

### Affectation of each individual
membership <- affectFuzzyIndiv(traj,center)

### Computation of the mean's trajectories
calculTrajFuzzyMean(traj,membership)

Run the code above in your browser using DataLab