# NOT RUN {
set.seed(2524)
diff_1 <- rnorm(10)
diff_2 <- rnorm(10)
N <- 500
th <- MASS::mvrnorm(N, mu = c(0, -1),
Sigma = matrix(c(1, .5 * 2, .5 * 2, 4), nrow = 2))
probs_1 <- 1 / (1 + exp(-outer(th[, 1], diff_1, "-")))
probs_2 <- 1 / (1 + exp(-outer(th[, 2], diff_2, "-")))
probs <- cbind(probs_1, probs_2)
dat <- apply(probs, 2, function(p) as.numeric(p > runif(N)))
get_ss(dat)
# }
Run the code above in your browser using DataLab