Abderrahim Oulhaj wrote:
Dear all,
I had something bizarre when I tried to get the inverse of the same
matrix with S-plus6.2 and R.
> A <- matrix(c(613537.28025, -49.536866569,-49.53687,
0.004000337),nrow = 2, byrow=TRUE)
With S-plus:
> solve(A)
Problem in solve.qr(a): apparently singular matrix
Use traceback() to see the call stack
With R:
> solve(a)
[,1] [,2]
[1,] 0.00880039 108.9767
[2,] 108.97675704 1349728.0536
Explanation?
Abderrahim
It is not bizarre; it is what one would expect from numerical linear
algebra. Both responses are reasonably correct. The matrix has a
condition number on the order of 10^12 so it is a judgement call whether
to regard it as computationally singular.
By the way, this is a symmetric matrix and positive definite so you
would be much better off using a Cholesky decomposition for which the
condition number is on the order of 10^6.
|