# Distance of a covariance matrix from a perfect 1:1 relationship

I have a number of estimated variance-covariance matrices, and I would like to know how different these are from a perfect 1:1 relationship. To be specific:

• They are (genetic) variance-covariances for males and females for the same trait.
• By perfect 1:1 relationship I mean that the correlation is 1, and that the variances are equal. So that all data would fall along y = x.
• I do not care about the scale of the variance-covariance matrix. The ellipse can be smaller or larger, but I do care about differences in variance between the two axes.

The context is that I'd like to know if you'd move e.g. 1 standard deviation in this 2D space, how much you expect to move away from equality between the axes (y = x).

I am imagining that if you would draw the variance-covariance matrix as an ellipse centered on (0, 0), there would be some sort of average distance to the line y = x. I suppose I could take a 100 points along the ellipse and calculate that distance, but wondering is there is something more straightforward available.

Does anyone know an existing distance metric that would make sense? Or another solution?

• There's a helpful way to visualize the differences: see stats.stackexchange.com/a/469966/919.
– whuber
Apr 27, 2021 at 20:09
• Thanks @whuber. I have something similar already working, I'm just trying to come up with a good way to express the difference between the data and a 1:1 relationship in a single number. Apr 27, 2021 at 20:16

For covariance matrices there is a distance metric called Riemannian distance. It's the length of geodesic in the space of positive definite matrices. The geodesic preserves the determinant of the matrix. The definition in Encyclopedia of Distances Section 12.3 is as follows: $$Sym^+(A,B)=\left(\sum_i\log^2\lambda_i\right)^{\frac 1 2},$$ where $$\lambda_i$$ - eigenvalues of matrix $$AB^{-1}$$.
• Thank you, this is helpful. I do care about the relative variances of the two axes (with unequal variances and correlation of 1 you still move away from y = x), so I don't think I want to use the correlation matrix. Apr 27, 2021 at 19:39