# Generating correlated discrete random variables

Suppose that we have $$q_t \in \{-1, 1\}$$ where $$\mathbb{P}(q_t = -1) = \mathbb{P}(q_t = 1) = \frac{1}{2}$$. Further, assume that \begin{align} Cor\left( q_t, q_{t-k} \right) = \begin{cases} \rho & k = 1\\ 0 & k > 1 \end{cases} \end{align} with $$0 < \rho < 1$$. How would I go about generating random sequences of $$q_t$$?

What I have so far:

Of course, a portion of the problem simplifies a bit here: \begin{align} E(q_t) &= \frac{1}{2}(-1) + \frac{1}{2}(1) = 0 \\ V(q_t) &= E \left[ \left(q_t - E(q_t) \right)^2 \right] \\ &= E \left( q_t^2 \right) = \frac{1}{2}(-1)^2 + \frac{1}{2}(1)^2 = 1 \\ \Rightarrow Cor(q_t, q_{t-1}) &= \frac{Cov(q_t, q_{t-1})}{ \sqrt{V(q_t) V(q_{t-1})} } \\ &= \frac{Cov(q_t, q_{t-1})}{V(q_t)} \\ &= Cov(q_t, q_{t-1}) \\ &= E \left[ q_t q_{t-1} \right]. \end{align}

I don't know how to proceed from here. I'm looking forward to a resolution -- I'd be using this to simulate a toy model for fun.

• It seems to me that there is a contradiction here. Consider the following expressions(from the given formula of corr): $Cor\left( q_t, q_{t-1} \right) = \rho, Cor\left( q_{t-1}, q_{t-2} \right) = \rho$ and $Cor\left( q_t, q_{t-2} \right)=0$. Now consider $\rho$ close to 1. Then $q_t$ and $q_{t-2}$ are highly linearly correlated with $q_{t-1}$. From this point, they are more or less linearly correlated, but the third expression say that $Cor\left( q_t, q_{t-2} \right)=0$. Nov 24, 2020 at 8:59
• Defining an iid sequence of $\epsilon_t\sim\mathcal B(1/\sqrt{2})$ and setting $q_t=\epsilon_t\epsilon_{t-1}$ leads to $\mathbb E[q_t]=1/2$, $\text{cov}(q_t,q_{t-1})=-1/4$ and $\text{cov}(q_t,q_{t-1-k})=0.$ Nov 24, 2020 at 9:40
• @TDT Consider an MA(1) process: $x_t = e_t + \theta e_{t-1}$ where $e_t \sim N(0,1)$ and $|\theta| < 1$. You can show that this process has $V(x_t) = 1 + \theta^2$ and that $Cov(x_t, x_{t-k}) = \theta E \left( e_t{t-1} e_{t-k} \right)$ for $k \geq 1$. For $k=1$, you get $\frac{\theta}{V(e_t)}$, but for $k > 1$, you get 0. The key point here: correlation is NOT transitive. $Cor(x,y), Cor(y,z) > 0$ doesn't necessarily imply $Cor(x,z) > 0$. Nov 24, 2020 at 16:00
• I do not have any objection to your examples. However, in my comment, I suppose that $\rho$ close to 1. When $\rho=0.9999$, to me, it seems not possible to have this $Cor(q_t,q_{t−1})=0.9999$, $Cor(q_{t−1},q_{t−2})=0.9999$ while $Cor(q_t,q_{t−2})=0$. Nov 24, 2020 at 19:18
• @TDT You can have an MA(1) with 0.99999999999 correlation at order 1, but 0 at order 2. That's a defining feature of an MA(q): autocorrelations at order beyond q are all exactly zero by construction. Nov 25, 2020 at 23:02