Skip to content

Instantly share code, notes, and snippets.

@cbare
Created November 14, 2012 01:10
Show Gist options
  • Select an option

  • Save cbare/4069566 to your computer and use it in GitHub Desktop.

Select an option

Save cbare/4069566 to your computer and use it in GitHub Desktop.
mvnorn test
library(MASS)
CreateSigma <- function(rho, p) {
aux1 <- matrix(rep(1:p, p), p, p)
aux2 <- matrix(rep(1:p, each = p), p, p)
rho^abs(aux1 - aux2)
}
rho <- 0.5
p <- 3
n <- 3
# set RNG seed
set.seed(72386)
m <- mvrnorm(n, rep(0, p), CreateSigma(rho, p))
@cbare
Copy link
Copy Markdown
Author

cbare commented Nov 19, 2012

This is a quick test to show that with the version change (7.3.20 -> 7.3.21) in the MASS library, the mvrnorm now returns different results for the same random seed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment