library(stochcorr)
# Generate 500 paths of two geometric Brownian motions, S1 and S2, of length 100 each
# following the von Mises process with mu=pi/2, lambda=1 and sigma =1
a<-stochcorr.sim(m=500,100,0.01,100,100,0.05,0.05,0.06,0.1,pi/2,1,1,"vmp")
t<-seq(0,100*0.01-0.01,0.01)
# Plot the first realization of S1 and S2
plot(t,a$S1[1,], ylim=c(min(a$S1[1,],a$S2[1,]),max(a$S1[1,],a$S2[1,])),type="l")
lines(t,a$S2[1,], col="red",type="l")
legend(0.01,max(a$S1[1,],a$S2[1,]), legend = c("S1","S2"), col = c("black", "red"), lty=1)
Run the code above in your browser using DataLab