I am would like to be able to efficiently generate PSD correlation matrices. My method slows down dramatically as I increase the size of matrices to be generated. - Could you suggest any efficient solutions? If you are aware of any examples in Matlab, I would be very thankful
- When generating a PSD correlation matrix how would you pick the parameters to describe matrices to be generated? An average correlation, standard deviation of correlations, eigenvalues?
asked
Edward |

Given any PSD matrix, you can cook up a joint normal distribution with that as the covariance matrix. So, barring a need for some specific attribute (such as deliberate multicollinearity), what I typically do is: generate a random square matrix M (which will be full rank with probability 1 if I use a continuous distribution for the components); compute M'M, which will be positive definite (that's my covariance matrix); then convert M'M to a correlation matrix by scaling by the standard deviations (computed from the variances on the diagonal of M'M). I usually only need low dimensional instances, but I think it's pretty efficient. This is a bit trickier. It's relatively easy to modify my method to produce a specific range of variances -- you just do a little scaling on the covariance matrix -- but it's rather hard to directly constraint the correlations. If you're willing to take a slower route, you can specify a Binomial distribution for the number of positive correlations (or a multinomial positive/zero/negative if you want to explicitly include zero correlations) along with a distribution (uniform? beta?) for their magnitudes, then solve a MIQP to find the coefficients of M (actually, just the upper triangle of M) that come closest to producing what you were looking for.
answered
Paul Rubin ♦♦ |