Covariance errors - mobeets/nullSpaceControl GitHub Wiki
Source: "A simple procedure for the comparison of covariance matrices"
Given: two samples D1
, D2
. We would like to find an error metric for the difference between cov(D1)
and cov(D2)
.
S1 = S2 + S3
S2
= error in covariance orientationS3
= error in covariance shape
High-level
- S1 (total): eigenvector from one sample should explain same amount of variance in both samples.
- S2 (orientation): one sample should be explained just as well by its ith eigenvector as by the other sample's ith eigenvector.
- S3 (shape): one sample should be as explained by its ith eigenvector as the other sample is explained by its ith eigenvector.
Low-level
Below, v_i12
is the variance in sample 1 explained by the ith eigenvector of sample 2. So v_11
and v_22
, for example, these are the eigenvalues of D1
and D2
, respectively.
Units
S1 can be normalized by the worst case scenario, which is when each data set has one axis of variance, and these axes are orthogonal. S1_max = 4*(sum(var(D1))^2 + sum(var(D2))^2)
. So you can normalize S1, S2, and S3 by this value to scale between 0 and 1.