Suppose I have three variables with a correlation matrix like this:
y1 y2 y3
y1 1.0 0.2 0.3
y2 0.2 1.0 0.4
y3 0.3 0.4 1.0
How could I draw a set of n
random bernoulli samples of y1
, y2
, y3
under this specified correlation parameters (maybe also with specified probability for each of them)? such like:
y1 y2 y3
1 1 1 0
2 0 1 1
3 0 0 0
4 0 0 1
5 1 0 0
6 0 1 0
....
n 1 0 0