n <- 10000
X <- rnorm(n, mean = 3, sd = 3)
Y <- rexp(n, rate = 2)
Z <- rnorm(n, mean = -2, sd = 0.5)

cov(X, Y)
cov(X, Z)
cov(Y, Z)

Suppose I know the marginal distributions of the random variables $X \sim N(3, 9)$, $Y \sim Exp(2)$, and $Z \sim N(-2, 0.025)$. However, I do not have any information on the joint distribution of $(X, Y, Z)$ and I do not know whether these r.v.s are independent or not.

I'm interested in estimating the covariance matrix $Cov\begin{bmatrix}X\\ Y \\ Z\end{bmatrix}$. Is it appropriate to do what I did above: generate observations from each marginal distribution and simply use the sample covariance as an estimate? i.e., cov(X, Y), cov(X, Z), cov(Y, Z) in R?

  • $\begingroup$ @stans thanks. would you like to add your comment as an answer? $\endgroup$
    – Adrian
    Jan 21, 2021 at 16:01
  • $\begingroup$ Sure. Have done it. $\endgroup$
    – stans
    Jan 21, 2021 at 16:14

1 Answer 1


No. What you did above is simulated $(X,Y,Z)$ where $X$, $Y$ and $Z$ are independent. The sample covariances will simply converge to 0 as $n$ converges to infinity. To simulate any random variables jointly, you have to have an idea how they are related


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.