# Generating correlation matrices using Wishart distribution

I have problem on generating correlation matrices using Wishart distribution. I read some articles about Wishart distribution, and it turns out that Wishart distribution is commonly used to generate covariance matrices. Is it possible to generate correlation matrices using Wishart distribution? Any information about useful sources about it?

• Do you know the relationship between a correlation matrix and a covariance matrix? If so, you can generate a covariance matrix using the Wishart distribution, then convert it to a correlation matrix. Just divide each $(i,j)^{th}$ entry ($i \ne j$) by the square root of the product of the $(i,i)^{th}$ and $(j,j)^{th}$ entries, and, afterwards, set all the diagonal entries equal to 1. Commented Feb 1, 2012 at 2:51
• Thank you for guide. I will try it. Do you know any article that ever use Wishart distribution to generate correlation matrices? Commented Feb 1, 2012 at 3:17
• @jbowman: Of course, if you drop the $i \neq j$ requirement in the first part of your remark, the second part becomes superfluous since the resulting diagonal entries will be one. :) Commented Feb 1, 2012 at 3:18
• @cardinal - but then you have to pay attention to the order of operations in whatever loop(s) you set up! Commented Feb 1, 2012 at 15:35
• @jbowman: Loops? ;) Commented Feb 1, 2012 at 16:02

Let $$S$$ be from Wishart$$(\Sigma,r)$$ and let $$D$$ be the diagonal matrix such that $$D_{ii} = \sqrt{S_{ii}}$$. Then $$R=D^{-1}SD^{-1}$$ will be a random correlation matrix. Actually one can easily check that if any $$S$$ at all is a covariance matrix then $$R=D^{-1}SD^{-1}$$ is a correlation matrix, because the matrix operation always divides each elements of S by the correct standard deviations.
Furthermore, because $$S$$'s diagonal elements are all positive with probability one, and the matrix $$D$$ is invertible if and only if the diagonal elements of $$S$$ are all positive, the matrix $$D$$ must be invertible with probability one.