[R] Singularity problem
Berend Hasselman
bhh at xs4all.nl
Wed Mar 16 21:47:09 CET 2011
On 16-03-2011, at 21:11, David Winsemius wrote:
>
> On Mar 16, 2011, at 1:32 PM, Berend Hasselman wrote:
>> .....
>> svd(a) indicates the problem.
>>
>> largest singular value / smallest singular value=1e17 (condition number)
>> --> reciprocal condition number=1e-17
>> and the standard solve can't handle that.
>
> Actually it can if you relax the default tolerance settings:
>
> > solve(a, tol=1e-21)
> [,1] [,2]
> [1,] 1e-20 -1e-20
> [2,] -1e-21 1e-03
> > a%*%solve(a, tol=1e-21)
> [,1] [,2]
> [1,] 1 0
> [2,] 0 1
Lesson: Use ? before replying:-)
Berend
More information about the R-help
mailing list