par(ask=TRUE)
### Default example
ex1 <- generateArtificialLongData()
ex1
plot(ex1,col=1,type.mean="n")
part1 <- partition(rep(1:4,each=50),4)
plot(ex1,part1)
### Three diverging lines
ex2 <- generateArtificialLongData(functionClusters=list(function(t)0,function(t)-t,function(t)t))
part2 <- partition(rep(1:3,each=50),3)
plot(ex2,part2)
### Three diverging lines with high variance, unbalance groups and missing value
ex3 <- generateArtificialLongData(
functionClusters=list(function(t)0,function(t)-t,function(t)t),
nbEachClusters=c(100,30,10),
functionNoise=function(t){rnorm(1,0,3)},
percentOfMissing=c(0.25,0.5,0.25)
)
part3 <- partition(rep(1:3,c(100,30,10)),3)
plot(ex3,part3)
### Four strange functions
ex4 <- generateArtificialLongData(
nbEachClusters=c(300,200,100,100),
functionClusters=list(function(t){-10+2*t},function(t){-0.6*t^2+6*t-7.5},function(t){10*sin(t)},function(t){30*dnorm(t,2,1.5)}),
functionNoise=function(t){rnorm(1,0,3)},
time=0:10,decimal=2,percentOfMissing=0.3)
part4 <- partition(rep(1:4,c(300,200,100,100)),4)
plot(ex4,part4)
### To get only longData (if you want some artificial longData
### to deal with another algorithm), use the getteur ["traj"]
ex5 <- gald(nbEachCluster=3,time=1:3)
ex5["traj"]
par(ask=FALSE)
Run the code above in your browser using DataLab