[R-sig-Geo] Fitting a SAR model with no covariates
Julian M. Burgos
ju||@n@burgo@ @end|ng |rom h@|ogv@tn@|@
Fri May 8 18:36:17 CEST 2020
Dear list,
I am trying to fit a very simple spatial autoregressive (SAR) model to measure the degree of spatial correlation in some dataset. The data consists of location (x, y) and some environmental parameter. The model I want to fit is of the form
y = rho * W * y + e
where y is a vector with the values of the environmental parameter, W is the matrix of spatial weights given by the inverse of squared distances among locations, rho is the autoregressive coefficient, and e is an error term. The model does not have any covariates.
I can get W (as a listw object) using the chooseCN function from the adelspatial package, doing something like this:
#---------------------------------------------------
data(OLD.COL)
xy <- as.matrix(COL.OLD[, c("X", "Y")])
W <- chooseCN(xy = xy, ask = FALSE, type = 7, dmin = 1,
plot.nb = FALSE, a = 2)
#---------------------------------------------------
But then I am a bit confused about how to fit the model itself using some of the functions from the spatialreg package, in particular because my model does not have covariates. The only thing I want to obtain is the rho parameter.
Any guidance will be welcomed!
Julian
--
Julian Mariano Burgos, PhD
Hafrannsóknastofnun, rannsókna- og ráðgjafarstofnun hafs og vatna/
Marine and Freshwater Research Institute
Botnsjávarsviðs / Demersal Division
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Netfang/Email: julian.burgos using hafogvatn.is
More information about the R-sig-Geo
mailing list