Guest User

Untitled

a guest
Jul 15th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. set.seed(100)
  2. n <- 1e6
  3. a <- 0.2
  4. b <- 0.1
  5. c <- 0.5
  6. z <- rnorm(n)
  7. x <- a*z + sqrt(1-a^2)*rnorm(n)
  8. y <- b*x - c*z + sqrt(1- b^2 - c^2 +2*a*b*c)*rnorm(n)
  9. cor(x, y)
Add Comment
Please, Sign In to add comment