Simulate two centered normal random variables with given variances and given covariance

234 Views Asked by At

How can I, by the central limit theorem, simulate two random variables $Z_{1}$ and $Z_{2}$ such that $$Z_{1}\sim N(0,\sigma^{2})\qquad Z_{2}\sim N\left(0,\dfrac{(\sigma^{2})^{3}}{3}\right)\qquad\mathrm{cov}(Z_{1},Z_{2})=\dfrac{1}{2}(\sigma^{2})^{2}$$ with $\sigma^{2}=4$? I take two random variable $U$ and $V$ with distribution $N(0,1)$ and generated the random variable $Z_{1}=\sigma U$ and $Z_{2}=\dfrac{1}{2}\sigma^{3}\left(U+\dfrac{1}{\sqrt{3}}V\right)$, but I'm not sure this really works. Thanks, any hint is really appreciated!

1

There are 1 best solutions below

4
On

For ordinary simulation, a box-muller/polar marsaglia/ziggurat algorithm with cholesky decomposition allows you to simulate a bivariate normal very efficiently. However as you said you want to apply the central limit theorem, which seems that you want to simulate a lot of random variables and show the convergence.

Assume you already have a random number generator which generate $\text{Uniform}(0,1)$. From the given condition, we know that $$Corr[Z_1, Z_2] = \frac {1} {2} (\sigma^2)^2 \sqrt{\frac {3} {\sigma^2(\sigma^2)^3 } } = \frac {\sqrt{3}} {2}$$ So we may try to simulate some easy bivariate distribution satisfying with this correlation requirement, and having mean zero. Let $X_1, X_2$ be a pair of discrete random variables, with $$ \Pr\{X_i = 1\} = \Pr\{X_i = -1\} = \frac {1} {2}, i = 1, 2$$ Let $\displaystyle \Pr\{X_1 = 1, X_2 = 1\} = p < \frac {1} {2}$. Then $$ \Pr\{X_1 = 1, X_2 = -1\} = \Pr\{X_1 = -1, X_2 = 1\} = \frac {1} {2} - p$$ $$ \Pr\{X_1 = -1, X_2 = -1\} = 1 - p - (1 - 2p) = p$$ and thus $$ Var[X_i] = E[X_i^2] = 1, Corr[X_1, X_2] = Cov[X_1, X_2] = E[X_1X_2] = 2p - (1 - 2p) = 4p - 1$$ So by setting $\displaystyle 4p - 1 = \frac {\sqrt{3}} {2} \Rightarrow p = \frac {\sqrt{3} + 2} {8} $, we can satisfy the correlation requirement. Now we have the algorithm.

The rest of the algorithm is left to you.

Edit: Ok it seems that I need to post the full algorithm out:

  1. Generate $U \sim \text{Uniform}(0,1)$
  2. Set $$ (X_{1,i}, X_{2,i}) = \begin{cases} (1, 1) & \text{if} & 0 < U < p \\ (-1, -1) & \text{if} & p < U < 2p \\ (1, -1) & \text{if} & \displaystyle 2p < U < \frac {1} {2} + p \\ (-1, 1) & \text{if} & \displaystyle \frac {1} {2} + p < U < 1 \\ \end{cases} $$ where $\displaystyle p = \frac {\sqrt{3} + 2} {8} $.
  3. Repeat step 1 and 2 for $i = 1, 2, \ldots, n$ times and obtain the following pair $$ \frac {1} {\sqrt{n}} \sum_{i=1}^n X_{1,i}, \frac {1} {\sqrt{n}} \sum_{i=1}^n X_{2,i} $$ By multivariate central limit theorem, this vector converges to the bivariate normal distribution $$ \mathcal{N}\left(\begin{bmatrix} 0 \\ 0\end{bmatrix}, \begin{bmatrix} 1 & \frac {\sqrt{3}} {2} \\ \frac {\sqrt{3}} {2} & 1 \end{bmatrix}\right)$$
  4. Finally, we scale this vector by setting $$Z_1 = \sigma\frac {1} {\sqrt{n}} \sum_{i=1}^n X_{1,i}, Z_2 = \frac {\sigma} {\sqrt{3}} \frac {1} {\sqrt{n}} \sum_{i=1}^n X_{2,i}$$ and this is one way to use simulation to illustrate the CLT.