KmL

KmL

Non-Parametric Algorithm for Clustering Longitudinal Data

Examples

Sommaire


More examples

Here are some extra examples on artificial data. For each, we give:

Three diverging lines

Artificial data parameters

Groupe A Groupe B Groupe C
Clusters size605040
Trajectory shape
Noise function
Missing in each cluster0%0%0%

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn1 <- generateArtificialLongData(
               nbEachClusters=c(60,50,40),
               functionNoise=function(t){rnorm(1,0,1.5)}
           )
    dn1 <- as.cld(dn1)
    plot(dn1)
    kml(dn1)

Three crossing lines

Artificial data parameters

Groupe A Groupe B Groupe C
Clusters size11010090
Trajectory shape
Noise function
Missing in each cluster0%0%0%

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn2 <- generateArtificialLongData(
               nbEachClusters=c(110,100,90),
               functionClusters=list(function(t){2},function(t){10},function(t){12-2*t}),
               functionNoise=function(t){rnorm(1,0,3)},
               time=0:6
	   )
    dn2 <- as.cld(dn2)
    plot(dn2)
    kml(dn2)

Four normal low

Artificial data parameters

Groupe A Groupe B Groupe C Groupe D
Clusters size200200200200
Trajectory shape
Noise function
Missing in each cluster0%0%0%0%

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn3 <- generateArtificialLongData(time=5:45,nbEachClusters=c(200,200,200,200),
	       functionCluster=list(
	           function(x){50*dnorm(x,20,2)},
                   function(x){50*dnorm(x,25,2)},
                   function(x){50*dnorm(x,30,2)},
                   function(x){25*dnorm(x,25,5)}
               ),
	       functionNoise=function(t){rnorm(1,0,1.5)}
           )
    dn3 <- as.cld(dn3)
    plot(dn3)
    kml(dn3)

Three lines and a polynome

Artificial data parameters

Groupe A Groupe B Groupe C Groupe D
Clusters size100100100100
Trajectory shape
Noise function
Missing in each cluster0%0%0%0%

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn4 <- generateArtificialLongData(
               nbEachClusters=c(100,100,100,100),
               functionClusters=list(
	           function(t){t},
	           function(t){0},
	           function(t){10-t},
	           function(t){-0.4*t^2+4*t}
	       ),
               functionNoise=function(t){rnorm(1,0,3)},
               time=0:10
	   )
    dn4 <- as.cld(dn4)
    plot(dn4)
    kml(dn4)

Three diverging lines with missing values

Artificial data parameters

Groupe A Groupe B Groupe C
Clusters size605040
Trajectory shape
Noise function
Missing in each cluster30%+column(5,10,15)30%+column(5,10,15)30%+column(5,10,15)

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn5 <- generateArtificialLongData(
               functionClusters=list(
	           function(t){t/2},
	           function(t){0},
	           function(t){-t/2}
	       ),
               functionNoise=function(t){rnorm(1,0,3)},
               nbEachClusters=c(100,100,100),
	       time=0:20,
	       percentOfMissing=c(0.3,0.3,0.3)
           )
    dn5 <- as.cld(dn5)
    dn5@traj[,c(5,10,15)]<-NA
    plot(dn5)
    kml(dn5)

Two sinusoïdals

Artificial data parameters

Groupe A Groupe B
Clusters size100100
Trajectory shape
Noise function
Missing in each cluster0%0%

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn6 <- generateArtificialLongData(
	       nbEachClusters=rep(100,2),
   	       functionClusters=list(
	           function(t){3*sin(t/2)},
                   function(t){6*sin(t)}
               ),
	       functionNoise=function(t){rnorm(1,0,3)},
               time=0:13
           )
    dn6 <- as.cld(dn6)
    plot(dn6)
    kml(dn6)

Three diverging lines, high variance

In this example, the high variance makes that the groups are very closed. Artificial data is build with 3 groups, but kml find only two.

Artificial data parameters

Groupe A Groupe B Groupe C
Clusters size605040
Trajectory shape
Noise function
Missing in each cluster30%30%30%

Graphical representation, Calinski criterion and execution

Click on the picture to start the demonstration.


R code

    dn7 <- generateArtificialLongData(
               functionNoise=function(t){rnorm(1,0,5)},
               nbEachClusters=c(100,100,100),
               time=0:20
           )
    dn7 <- as.cld(dn7)
    plot(dn7)
    kml(dn7)