I would like to find a simple way to generate two correlated random variables under the condition that each r.v has a same discrete distribution (for example Bernoulli distribution) This link provides a solution but I wonder if there is something more straightforward.
Thanks !
Simplest example I can think of:
Let $X_1, X_2, X_3$ be iid Bernoulli with success probability $\theta = 1/2.$ Then $Y_1 = X_1 + X_2$ and $Y_2 = X_2 + X_3$ are both $Binom(2, 1/2),$ but they are correlated.
Because you mention 'generating' here is a simple simulation in R:
Many possible variations with $W_1 = X_1 + aX_2$ and $W_2 = aX_2 + X_3$, for various values of $a.$