returns.sim <-
function(volvec,indexvol,beta,nSim=10000)
{
covmat<-indexvol^2*beta%*%rbind(beta)
diag(covmat)<-volvec^2
p <- length(beta)
R <- matrix(rnorm(p*nSim),nrow=nSim,ncol=p)%*%chol(covmat)
exp(R)-1
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.