The determinant is a polynomial in the entries, and is therefore known to be unstable for large matrices.
Are you using the determinant to find out if a matrix is singular? If so, there are better (more stable) ways to determine singularity.
Or does the determinant appear in the LL formula and you need to compute it explicitly? If so, compute the log-determinant (which should be stable) and exponentiate, assuming the log-det is less than CONSTANT('LOGBIG').
Is the matrix positive definite (a correlation or covariance matrix)? If so, you can compute the log-det as follows:
Let G = root(A) be the Cholesky root of the matrix A.
Then log(det(A)) = log(det(G`*G)) = log(det(G`)*det(G)) = 2*log(det(G))
Since G is triangular, det(G) = prod(diag(G)) and therefore log(det(G))=sum(diag(G)).
So your formula for log(det(A)) is 2*sum(log(diag(root(A)))). In SAS/IML you would use the VECDIAG function to get the diagonal elements of a matrix.
Message was edited by: Rick Wicklin