How do I generate n random variables,
Xi∈{−1,1} with known probabilities
pi=P(Xi=1) and
pij=P(Xi=1∧Xj=1)+P(Xi=−1∧Xj=−1)?
I found a package for R for simulating binary variables (i.e.
Xi∈{0,1}), however, it doesn't produce the correct result if I...