# NOT RUN {
data(ma2)
set.seed(100)
# generate 1000 simualtions from the ma2 simulation function
x <- t(replicate(1000, ma2_sim(ma2$start, 10)))
corr1 <- cor(x) # traditional correlation matrix
corr2 <- gaussianRankCorr(x) # Gaussian rank correlation matrix
par(mfrow = c(1, 2))
image(corr1, main = 'traditional correlation matrix')
image(corr2, main = 'Gaussian rank correlation matrix')
std <- apply(x, MARGIN = 2, FUN = sd) # standard deviations
cor2cov(gaussianRankCorr(x), std) # convert to covariance matrix
# }
Run the code above in your browser using DataLab