I use the function below to generate the betas for a given set of guess lambdas from my optimiser.
When running I often get the following warning message:
Condition number (Maximal singular value/Minimal singular value)
is another good method:
cond(A)
It uses svd
. It should be as close to 1 as possible. Very large values mean that the matrix is almost singular. Inf
means that it is precisely singular.
Note that almost all of the methods mentioned in other answers use somehow svd
: