Message-ID: <C72285BB-9A62-45EA-AF99-2161EB68545A@noc.soton.ac.uk>
Date: 2007-12-12T11:13:06Z
From: robin hankin
Subject: Matrix Inversion
In-Reply-To: <d3a104da0712120259r6a31e546t15aedb97f3bb0426@mail.gmail.com>
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