I thought it'd be possible to use any combination of correlations and standard deviations to generate correlated standard normal draws.
The intent is to get around checking whether the variance-covariance matrix $\Sigma$ is positive-definite.
In the three-variable case, my idea is, given a vector of standard deviations $(\sigma_X, \sigma_Y, \sigma_Z)$ and a triple of correlations, $(\rho_{XY}, \rho_{XZ}, \rho_{YZ})$, we construct $\Sigma$ as
$$\Sigma = \begin{bmatrix} \sigma_X & 0 & 0 \\ 0 & \sigma_Y & 0 \\ 0 & 0 & \sigma_Z \end{bmatrix} \begin{bmatrix} 1 & \rho_{XY} & \rho_{XZ} \\ \rho_{XY} & 1 & \rho_{YZ} \\ \rho_{XZ} & \rho_{YZ} & 1 \end{bmatrix} \begin{bmatrix} \sigma_X & 0 & 0 \\ 0 & \sigma_Y & 0 \\ 0 & 0 & \sigma_Z \end{bmatrix} = \begin{bmatrix} \sigma_X^2 & \sigma_{XY} & \sigma_{XZ} \\ \sigma_{XY} & \sigma_Y^2 & \sigma_{YZ} \\ \sigma_{XZ} & \sigma_{YZ} & \sigma_Z^2 \end{bmatrix} $$
With $\Sigma$ in hand, we draw standard normal variates $Z$ and correlate them with the transformation
$$ F = L\Sigma $$
Where $L$ is such that $LL^{T} = \Sigma$ (e.g., Cholesky decomposition). And voila, $F \sim N(0, \Sigma)$!
I thought we'd be able to specify whatever (valid) values of $\sigma_k$ and $\rho_{ij}$ we'd like, but in coding this up I seem to have created an invalid $\Sigma$:
sds = c(.05, .05, .05)
corr = c(0, .385, .97)
#generate center matrix
corr_mat = diag(3)
corr_mat[lower.tri(corr_mat)] = corr_mat[upper.tri(corr_mat)] = corr
#generate sigma
sigma = diag(sds) %*% corr_mat %*% diag(sds)
#get L
chol(sigma)
Error in
chol.default(sigma)
: the leading minor of order 3 is not positive definite
How can $\Sigma$ not be positive definite? Is there some restriction on the relative magnitude of standard deviations and correlations? I thought the answer is no...
$\Sigma$ is definitely not positive definite:
eigen(sigma)$values
# [1] 0.0051090288 0.0025000000 -0.0001090288
I see the negative eigenvalue is very small... is this possibly just a numerical problem?