Skip to content

Error message --- stsls and lagsarlm!

2 messages · Qiuhua Ma, Roger Bivand

#
Hi,

I run spatial lag model with k nearest neighbor weight matrix using both
stsls and lagsarlm!

I tried k=4:
#stsls method
knn4nwuilistws)
Error in base::chol2inv(x, ...) :
 element (89, 89) is zero, so the inverse cannot be computed

#ML method
knn4nwuilistws)
Warning messages:
1: In lagsarlm(fm1, data = sales.nonwuidata.sp, knn4nwuilistws) :
  inversion of asymptotic covariance matrix failed for tol.solve = 1e-10
  reciprocal condition number = 3.30065e-13 - using numerical Hessian.
2: In sqrt(diag(fdHess)[-1]) : NaNs produced

I also tried other weight matrix but got the same error message. Any
suggestions on how to deal with the error/warning message...

thanks,

Chelsea
#
On Wed, 2 Sep 2015, Qiuhua Ma wrote:

            
Since the problem does not appear to come from the weights, it probably 
comes from the data. Could you look at the VIFs in a regular lm() to see 
whether your covariates are close to collinear? Your formulae do not 
indicate how many columns there are in the model matrix (89 is a large 
number - are many of the RHS variables factors, are you using many 
dummies?).

Running traceback() after the failure in stsls() would show the context of 
the error.

Roger