I have a function which takes an inverse of a matrix, say mat
. I would like to take an inverse only if the matrix is invertible using solve
function. So, I would like to make some check statement like;
if (rcond(mat) > smallnumb)
{
smat <- solve(mat)
}
I do not want to make smallnumb
to be too large because I want to take an inverse when I can.
My question is how small does the smallnumb
have to be.