[R-sig-Geo] Residual mapping and spatial autocorrelation. SAR model.

Maximilian Sproß Maximilian.Spross at uibk.ac.at
Mon Jan 9 12:10:23 CET 2012


Dear list members!

To map residuals from a single linear regression model which is based on 
high resolution raster data (cellsize 5m, approx. n=290000), i try to 
take into account for spatial autocorrelation in the residuals. Several 
morphometric layers (e.g. slope, solar potential, elevation etc.) serve 
as predictors in order to explain surface elevation changes of a glacier 
surface.

By using SAR model with spatial weights (neighbor list object with 3,984 
neighbors per observation in average) which were generated based on the 
current predictor, a very efficient fit results. Hence, the residual map 
shows small values almost across the whole surface. The same model with 
each of the other predictors leads to almost the same fit and a similar 
residual map.

The problem is, that if i take the autocorrelation into account and 
model with SAR, i cannot identify spatial patterns of the quality of the 
fit in relation to different predictors. If i model with OLS, i get 
sensible variations between the different residual maps, but the 
residuals are strongly autocorrelated as this is natural for high 
resolution raster data.

- Do you have any ideas about an other approach for defining spatial 
weights?

- Are there any legitimations for ignoring the autocorrelated residuals 
of the OLS model since the research objective is to derive sensible 
variations in the residual maps?

### selected code for calculating spatial weights and performing SAR: ###

library(gstat)
library(sp)
library(spdep)
library(rgdal)

dst <- max(slot(slot(elev, "grid"), "cellsize"))
elev_nb <- dnearneigh(coordinates(elev), 0, dst)
sp_weights <- nb2listw(elev_nb)

dif_vec <- c(dif at data$band1)
elev_vec <- c(elev at data$band1)

sp_fit <-  spautolm(dif_vec~slope_vec, listw = sp_weights, family="SAR", 
method="Matrix", na.action=na.exclude)

#################

system: linux high performance cluster node with 2 Intel Quad-Core L5420 
CPUs (8 cores running on 2.5 GHz), 32 GB DDR2 RAM (4 GB per core)
R version 2.13

Thank you very much in advance!

Max



More information about the R-sig-Geo mailing list