[R] Matrix Inversion
Robin Hankin
r.hankin at noc.soton.ac.uk
Wed Dec 12 12:13:06 CET 2007
Hello Wang
matrix bb is symmetric positive semidefinite, so
algebraically the eigenvalues are nonnegative.
I would use
bb <- crossprod(b)
to calculate bb (faster and possibly more accurate)
Look at eigen(bb,TRUE,TRUE)$values
(see ?eigen for the meaning of the arguments) to see how
many very small eigenvalues you have. The number of zero
eigenvalues is equal to the number of linear relations
in the columns of b.
HTH
rksh
On 12 Dec 2007, at 10:59, Wang Chengbin wrote:
> I got the following error:
>
> a = read.csv("mat.csv")
> b = as.matrix(a)
> tb = t(b)
> bb = tb %*% b
> dim(bb)
> ibb = solve(bb)
> bb %*% ibb
>
>> ibb = solve(bb)
> Error in solve.default(bb) :
> system is computationally singular: reciprocal condition number =
> 1.77573e-19
>>
> Are there any ways to find more information about why it is singular?
>
> Thanks.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Robin Hankin
Uncertainty Analyst and Neutral Theorist,
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
tel 023-8059-7743
More information about the R-help
mailing list