MATLAB: Invers from covariance of a matrix*matrix’

covarianceinversmatrix

given a is a matrix, is the matrix of covariance of (a*a') is always singular?

Best Answer

cov(a) is ALWAYS singular for ANY square matrix a, because you subtract off the column means. This guarantees that you reduces the rank by one (unless it is already singular) before multiplying the matrix with its transpose.
a = rand(5,5); % a is an arbitrary square matrix
rank(a) %<-- is 5
a2 = bsxfun(@minus, a, mean(a));
rank(a2) %<-- is now 4
cova = a2'*a2/4 %<-- (rank 4) x (rank 4) = rank 4
cov(a) %<-- This is the same as "cova"
rank(cova) %<-- verify this is rank 4
Related Question