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

Roger Bivand Roger.Bivand at nhh.no
Mon Jan 9 14:14:08 CET 2012


On Mon, 9 Jan 2012, Maximilian Sproß wrote:

> 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

This number looks very large, given your definition below, taking the 
maximum cell size as the threshold.

> 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.
>

The spatial autocorrelation modelled in the bivariate models is picking up 
the spatial patterning of the missing covariates. With your high 
resolution, they are all likely to be highly autocorrelated.

> - 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?

If (and only if) the OLS and SAR coefficients are the same, you can trust 
the OLS coefficients. If they are not, the model has other 
misspecifications in addition. What you cannot trust are the OLS 
coefficient standard errors, as they are biased by the residual 
autocorrelation. So it depends rather on what you mean by "sensible".

Hope this clarifies,

Roger

>
> ### 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
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list