# Fix seed for reproducibility
set.seed(123)
# Sample outlying indices
cont.ind <- sample(1:50,size=10)
# Generate 50 curves on the interval [0,1] at 50 timepoints with 20% outliers
y <- mrct.rgauss(x.grid=seq(0,1,length.out=50), N=50 ,model=1,
outliers=cont.ind)
# Visualize curves (regular curves grey, outliers black)
colormap <- rep("grey",50); colormap[cont.ind] <- "black"
matplot(x=seq(0,1,length.out=50), y=t(y), type="l", lty="solid",
col=colormap, xlab="t",ylab="")
Run the code above in your browser using DataLab