# Generating random numbers based on partial correlation data

I need to generate random numbers based on already existing partial correlation data (not correlation or covariance data). Specifically, a 168*12 matrix based on a 12*12 partial correlation matrix. The idea is to simulate a data matrix that can be used for testing a few components of a project.

Any help in this regard would be appreciated. I have looked around but have not found any threads that talk about doing this with partial correlation data.

If someone has ideas about implementation in MATLAB, that would be a bonus!

-What I mean by partial correlation matrix is a matrix containing the partial correlations, calculated for any two pairs by partialling out effect of all other pairs.

-The goal is: given a matrix of partial correlation values, is there a way I can generate a data set (168*12) that would have these partial correlation values?

-If there is a method to convert partial correlation to correlation values, that would be appreciated as well.

Thanks again!

• This is a cross-post stackoverflow.com/questions/18871792/… Please decide whether it belongs here (as I'd say) or on SO and ask a moderator to migrate or perhaps close it.
– Momo
Sep 18, 2013 at 12:40
• Could you please explain precisely what you mean by a "partial correlation matrix"? Is this a correlation matrix, a correlation matrix with missing entries, or a matrix of partial correlations?
– whuber
Sep 18, 2013 at 13:54
• @whuber the partial acf is the conditional acf. THe relationship between the pacf and the acf is the same as that between partial regression coefficients and regression coefficients. It is a matrix of partial (auto) correlations. Sep 18, 2013 at 15:15
• @Irish Thank you. Your interpretation might be correct or it might not: it assumes this is a question about time series, even though time series have not been mentioned or tagged. (The value of 168 = 7*24 certainly is suggestive.) I want to hear from the original poster concerning his question rather than guesses (no matter how intelligent or well-meaning) from others.
– whuber
Sep 18, 2013 at 16:07
• @whuber What I meant by a partial correlation matrix is a matrix that has partial correlations in it (calculated for any two pairs of entries by partialling out all other pairs. In your words "a matrix of partial correlations". Yes, this is regarding time series as you have rightly pointed out. It is on the lines of back calculating a time series (168*12) if I have a pre-defined matrix having partial correlation data. Sep 20, 2013 at 6:12

Let $P$ = a 12 x 12 matrix with 1s on the diagonals and the negatives of the partial correlations on the offdiagonals, and let $Q = P^{-1}$. Then the original correlation between variables $i$ and $j$ is $r_{ij} = q_{ij}/\sqrt{q_{ii}q_{jj}}$.