Hi,
I run spatial lag model with k nearest neighbor weight matrix using both
stsls and lagsarlm!
I tried k=4:
nb4nwuisale <- knn2nb(knearneigh(sales.nonwuidata.sp, k = 4))
knn4nwuilistws <- nb2listw(nb4nwuisale, style="W")
sp.lagsls.knn4nwuilistws <- stsls(fm_comrisk, data=sales.nonwuidata.sp,
knn4nwuilistws)
Error in base::chol2inv(x, ...) :
element (89, 89) is zero, so the inverse cannot be computed
#ML method
sp.lagml.knn4nwuilistws <- lagsarlm(fm_comrisk, data=sales.nonwuidata.sp,
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...