[R-sig-Geo] warning in errorsarlm

Pascal Title pascaltitle at gmail.com
Sun Jun 5 23:58:45 CEST 2016


Hi,

I am trying to fit a simultaneous autoregressive model to some data using
the spdep package. In order to identify the appropriate spatial distance to
use, I use the correlog function to find the distance at which spatial
autocorrelation of the residuals from a linear model drops to 0.

When I run this code, I get a warning that states:
In errorsarlm(dat$rangeSize ~ dat$clim, listw = nlw, na.action = na.omit,  :
  inversion of asymptotic covariance matrix failed for tol.solve = 1e-10
  reciprocal condition number = 1.64249e-12 - using numerical Hessian.

I don't know enough about these models or the model fitting procedure to
understand whether or not this is a warning that can safely be ignored, or
if this is an indication that the results of the regression cannot be
trusted. Is there something I can/should do to improve the model fitting
procedure?

Thanks!

-Pascal

the data can be downloaded from here:
https://dl.dropboxusercontent.com/u/34644229/sampleDat.rds

code:

library(ncf)
library(spdep)

dat <- readRDS('sampleDat.rds')

fit1 <- lm(dat$rangeSize ~ dat$clim)
x <- dat$long
y <- dat$lat
z <- fit1$residuals
co <- correlog(x, y, z, increment = 500, resamp = 0, latlon = FALSE, na.rm
= TRUE)
nei <- dnearneigh(cbind(x, y), d1 = 0, d2 = co$x.intercept, longlat = FALSE)
nlw <- nb2listw(nei, style = "W", zero.policy = TRUE)

m1 <- errorsarlm(dat$rangeSize ~ dat$clim, listw = nlw, na.action =
na.omit, zero.policy = TRUE)
summary(m1, Nagelkerke = TRUE)

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list