powered by
Simulate stocks prices following multivariate normal distribution.
rMvReturnSim( names, date, mu = rep(0, 2), sigma = matrix(c(1, 0.5, 0.5, 1), 2, 2) )
Multivariate stock prices
vector of names
vector of time, must be "Date" type
vector of mu
mu
vector of sigma
sigma
names <- c("swan", "bear") date <- as.Date("2015-01-01") + days(0:29) rMvReturnSim(names, date)
Run the code above in your browser using DataLab