n<-100 m<-100 t<-seq(0,1,length.out=m+1) W<-matrix(0,n,m+1) for (i in 1:n){ Y<-rnorm(m) W[i,]<-1/sqrt(m)*c(0,cumsum(Y))} matplot(t,t(W),type="l",lty=1) mw<-apply(W,2,mean) lines(t,mw,lwd=2) persp(t,t,cov(W)) contour(t,t,cov(W)) image(t,t,cov(W),col=heat.colors(100)) library(lattice) levelplot(cov(W),drape=T)