Looking for a simple bivarate uniform distribution with non-zero covariance matrix

57 Views Asked by At

Obviously there are many forms this can take, I'm looking for on that gives an non-zero (off diagonal elements) covariance matrix. Does anyone know of one?

1

There are 1 best solutions below

0
On

Here is one. Let $\rho$ be the correlation between the two uniform [0,1] random variables $X$ and $Y.$ Generate $X \sim \mathrm{Unif}[0,1].$ Then if $\rho \lt 0,$ set $$T={1-\sqrt{1-{2 \over 3} ( 1 + \rho )} \over 2} \ .$$ Otherwise set $$T={1-\sqrt{1-{2 \over 3} ( 1 - \rho )} \over 2} \ .$$ Now again if $\rho \lt 0,$ generate $$Y = \begin{cases} T-X \ , & \text{if} \ X \leq T \\ T-X+1 \ , & \text{if} \ X \gt T \end{cases} $$ If $\rho \geq 0,$ generate $$Y = \begin{cases} X+1-T \ , & \text{if} \ X \leq T \\ X-T \ , & \text{if} \ X \gt T \end{cases} $$