I have to simulate 1000 random paths for the next 10 days of a stock's value. Here is my code, but it doesn't work:
for(i in 1:90) { # simulate price for future 90 days
z<-rnorm(3) # generate normal random vector
v<-mu+t(C)%*%z # transform to multivariate normal
s1<-s0*(1+v) # new stock price
s<-rbind(s,t(s1)) # append s1 to s
s0<-s1 # update s0
}