Simulate a multivariate binary distribution

  • Thread starter Thread starter JJH
  • Start date Start date

JJH

Joined
12/1/10
Messages
24
Points
11
How do I generate n random variables, \(X_i\in\{-1,1\}\) with known probabilities \(p_i=P(X_i=1)\) and \(p_{ij}=P(X_i=1 \wedge X_j=1)+P(X_i=-1 \wedge X_j=-1)\)?

I found a package for R for simulating binary variables (i.e. \(X_i\in\{0,1\}\)), however, it doesn't produce the correct result if I change zeros to ones after random variables have been generated.
 
Back
Top Bottom