# Covariance and correlation matrix comparison

I am aware that this question may be too broad and that answers are scattered in various posts, but i need concise and organized answer.

My dataset consists of linear measurements of cranial dimensions on 600 individual roe deer (50 distinct measurements with a dial caliper). I divide this dataset to unequal groups (corresponding to population membership), and caluclate correlation or covariance matrix so that every population is represented by 50x50 matrix.

My question is, what is the best way to compare those matrices, both for equality and pattern (excluding Mantel test)? Problematic part may be the fact that those matrices are rarely of full rank since many measured characters are significantly correlated. Also, that comparison should include some kind of confidence intervals.

Edit:

In the meantime I have found one possible solution, I just need to implement it in R code. This paper suggests possible distances based comparisons that I really need.

The Euclidean distance as a simple method like this (Si is a sample covariance matrix):

$d_e(S_1,S_2) = \sqrt {tr((S_1-S_2)^t(S_1-S_2))}$

which I implemented in R code like this (although unsure):

covDif <- sqrt(t(cov(malesMab)-cov(malesMbm))*(cov(malesMab)-cov(malesMbm)))
sqrt(sum(diag(cov(covDif))))


But this distance is not good for comparison and of all the distances suggested in the mentioned paper the Cholesky decomposition is the best but I dont know how to program it in R. This is its form:

$d_e(S_1,S_2) = chol(S_1)-chol(S_2)$

which I tried like this (just substituting in the upper equation)

covDif <- sqrt(t(chol(cov(malesMab))-chol(cov(malesMbm)))*(chol(cov(malesMab))-chol(cov(malesMbm))))
sqrt(sum(diag(cov(covDif))))
`

which works, but encounters rank deficiency problems which I hoped to avoid by using Cholesky decomposition.

Any suggestions?

• Why do you want to compare the correlation matrices, and not apply a suitable tool to the 600x50 matrix with the population membership as the dependent variable? What do you actually want to find out? – January Sep 27 '13 at 12:54
• Actually, this is a common thing in evolutionary biology and modeling the effect of natural selection. Its effect is dependent on the pattern and strength of covariance/correlation between measured traits, not just the simple inter-group comparison. I just wanted to explore additional possibilities. – Fedja Blagojevic Sep 27 '13 at 19:06