Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. mu1 <- 0
  2. mu2 <- 1
  3.  
  4. sd1 <- 1
  5. sd2 <- 3
  6.  
  7. N <- 10^4
  8.  
  9. z <- rnorm(N, mean = mu1, sd = sd1) + rnorm(N, mean = mu2, sd = sd2)
  10.  
  11. x <- rbinom(N, size = 1, prob = exp(z)/(exp(z)+1))
  12.  
  13. u <- exp(z)
  14.  
  15. y <- rbinom(N, size = 1, prob = u/(u+1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement