par(ask=TRUE)
### Default example
ex1 <- generateArtificialLongData()
ex1
plot(ex1,colorTraj="black",colorMean="no")
plot(ex1)
### Three diverging lines
ex2 <- generateArtificialLongData(functionClusters=list(function(t)0,function(t)-t,function(t)t))
ex2
plot(ex2,colorTraj="black",colorMean="no")
plot(ex2)
### 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(40,20,10),
functionNoise=function(t){rnorm(1,0,3)},
percentOfMissing=c(0.25,0.5,0.25)
)
ex3
plot(ex3,colorTraj="black",colorMean="no")
plot(ex3)
### Four strange functions
ex4 <- generateArtificialLongData(
name="Four strange functions",
clusterNames=c("Line","Poly2","Normal","Sinus"),
nbEachClusters=c(100,300,200,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,5)},
time=0:10,decimal=2,percentOfMissing=0.3)
ex4
plot(ex4,colorTraj="black",colorMean="no")
plot(ex4)
### To get only trajectories (if you want some artificial trajectories
### 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