[R-sig-Geo] spdep: stsls; tot.solve=1e-12

Roger Bivand Roger.Bivand at nhh.no
Thu Apr 23 13:29:15 CEST 2009


On Wed, 22 Apr 2009, Adam Okulicz-Kozaryn wrote:

> Hello,
> i am trying to run  stsls from spdep, and I am getting error:
>
> Error in solve.default(ZpZp) :
>  system is computationally singular: reciprocal condition number = 0
>
> I would get the same error in lagsarlm, but I can fix it by setting

I don't think that this is the same problem. In the *sarlm case, the 
problem is only in computing the asymptotic covariance matrix, and occurs 
when the scaling of rho or lambda and the betas varies a lot.

Here it is occurring in the middle of TSLS, and suggests that there are 
colinearities around at the second stage, probably between yendp, the 
fitted endogenous lagged y and X (yendp fitted using X and WX). Setting 
the tolerance for solve will not help here at all. If you like, set 
debug(spdep:::tsls) and before running solve(ZpZp), eyeball the values 
going into Zp (cor(Zp) for example, or pairs(Zp)).

Hope this helps,

Roger

>
> tot.solve=1e-12
>
> as suggested here
> http://www.nabble.com/Error-in-spdep%3A-system-is-computationally-singular-tt19880274.html#a19896513
>
> I cannot do that in stsls. I already rescaled variables to similar scale. Is
> there any way to fix that?
> best,
> adam
>
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list