# How to calculate the Diagonal loading factor evaluate calculate the inversion of a covariance matrix

I am programming a Generalised Likelihood Ratio Test (GLRT) detector. When it comes to inverting a covariance matrix $Ri$, I need to do a diagonal loading to fix the problem of sigularity of this matrix, but I don't have any info about the technique or algorithm that allows to estimate the right diagonal loading factor factor $\sigma$.

Rather than calculate inverse ($Ri$) I have to calculate inverse ($Ri +\sigma \cdot I$) where $Ri$ is the covariance matrix.

Short answer: just use $\sigma = 10^{-8}$.
Covariance matrices have eigenvalues $\geq 0$ (theoretically),
so $Ri + 10^{-8} \, I$ will have eigenvalues $\geq 10^{-8}$, safely non-singular.

split Covar = S + N, "signal" + "noise", by eigenvalues or by SVD, Singular-value decomposition aka PCA, Principal component analysis. This has several advantages: