How to generate 2 correlated sequences from a binomial distribution?

256 Views Asked by At

After careful examination on the forum, I couldn't find a question that corresponds to my problem. So here it goes:

Basically, I am actually working on a research in the field of economics and I would like to model a sequence of shocks that are drawn from a binomial distribution. For simplicity, I would like to generate two sequences of 0 and 1 such that the two random sequences are correlated between each other. In particular, when the correlation is large, I would like that the probability that the state is 0 for both sequences (at some period), for example, is larger. Thus, I would also like to be able to control the correlation manually.

To summarise: I would like to create two correlated sequence of random numbers drawn from a binomial distribution where I could influence the likelihood that both series take the same value at the same time. I hope it is sufficiently clear.

Could you think of ways to model this or recommend relevant literature on the matter? Or, also possibly tips on how I could generate such sequences using softwares such as Matlab?

Thanks a lot in advance for your answers. I remain obviously at your disposal should you require further indications.

Brendan

Edit:

Both sequences follow strictly similar distribution with same parameters' values. The values of these parameters are exogenously given.

1

There are 1 best solutions below

3
On BEST ANSWER

Let us create two correlated random variables with Bernouilli-distribution.

Assign probabilities $p_{i,j}$ for $\langle i,j\rangle\in\Omega:=\{(0,0),(1,0),(0,1),(1,1)\}$.

This such that their sum is $1$.

Let $\langle B_1,B_2\rangle$ take values in $\Omega$ with $\mathsf P(B_1=i,B_2=j)=p_{i,j}$.

Then $B_1\sim\mathsf{Bern}(p_1:=p_{1,0}+p_{1,1})$ and $B_2\sim\mathsf{Bern}(p_2:=p_{0,1}+p_{1,1})$.

Further $\mathsf EB_1B_2=p_{1,1}$ so that $\mathsf{Cov}(B_1,B_2)=p_{1,1}-p_1p_2$.

Denoting $q_1:=1-p_1$ and $q_2:=1-p_2$ we have $\mathsf{Var}(B_i)=p_iq_i$ for $i=1,2$.

This leads to correlation:$$\rho:=\rho(B_1,B_2)=\frac{p_{1,1}-p_1p_2}{\sqrt{p_1q_1p_2q_2}}=\frac{p_{1,1}-(p_{1,0}+p_{1,1})(p_{0,1}+p_{1,1})}{\sqrt{(p_{1,0}+p_{1,1})(p_{0,1}+p_{0,0})(p_{0,1}+p_{1,1})(p_{1,0}+p_{0,0})}}$$

Now let $X_1=\sum_{k=1}^nB_{1,k}$ and $X_2=\sum_{k=1}^nB_{2,k}$ where the $\langle B_{1,k},B_{2,k}\rangle$ are iid having the same distribution as $\langle B_1,B_2\rangle$.

Then $X_1\sim\mathsf{Binom}(n,p_1)$ and $X_2\sim\mathsf{Binom}(n,p_2)$ and $\rho(X_1,X_2)=\rho(B_1,B_2)=\rho$.

The value of $\rho$ can be manipulated by manipulating the probabilities $p_{i,j}$.


Is this helpful somehow? I am not really familiar with methods that generate sequences like this. For that I am too much a theoretician.