Solved – Construct a correlation matrix based on pairwise correlation coefficients

correlation

For the purpose of simulation, I would like to construct such a correlation matrix that would respect to some extend the given set of preferable/desirable correlation coefficients for each pair of variables.

I tried filling in a matrix with the given coefficients and then enforcing the sum of absolute values of off-diagonal entries in each row/column to be smaller than one. It works, but it considerable weakens the given correlations, which I would like to avoid (as much as possible).

I would appreciate any suggestions. Thank you!

Regards,
Ivan

Best Answer

Arranging the correlations into a matrix: Let $\rho_{ij}$ be the correlation between variables $i$ and $j$. Place $\rho_{ij}$ into positions $(i,j)$ and $(j,i)$ of the correlation matrix. Note that $\rho_{ii}=1$, so place $1$'s down the diagonal. If the set of correlations is consistent, the matrix you have is a proper correlation matrix.

Sometimes (depending on how they were obtained), it turns out that the set of correlations doesn't form a proper correlation matrix. One way to check whether you do is to take the singular value decomposition and check all the singular values are non-negative.

[Such problems with a matrix that is "put together" are common. For example, pairwise correlation coefficients may have been generated from sets of observations where - due to partially missing observations, for example - different observation-pairs are available between different pairs of variables. If pairwise correlations are computed on all available data, sometimes the resulting correlation matrix is not positive semi-definite.]

If the constructed correlation matrix is not positive semi-definite, one simple approach to finding a valid correlation matrix near to the constructed one is to compute a singular-value decomposition and then set all negative singular values to zero, at which point you have the SVD of a correlation matrix which is often fairly close to the original. (There are alternatives, such as described at the link I gave in comments.)

Related Question