[R-sig-Geo] Different Moran's I correlograms using correlog{ncf} and sp.correlogram{spdep}

Roger Bivand Roger.Bivand at nhh.no
Thu Jan 29 12:56:15 CET 2009


On Thu, 29 Jan 2009, Xingli Giam wrote:

> Hello List,
>
> I have been bothered by this problem for the entire day, hope someone 
> can give me a hand here. Thanks in advance for reading! It could be 
> really simple and basic so hope you guys bear with it.
>
> We often plot Moran's I spatial correlograms that contrast glm residuals 
> and spatial model residuals (after incorporating spatial autocorrelation 
> (SAC) via SEVM, autocov reg, etc) over lag distance classes.

A spatial correlogram is not a well-defined concept. One view is that the 
inter-pair distances should be binned, and the output computed for the 
pairs of observations in each bin - equivalent to defining widening rings 
of neighbours for each observation. There are issues that arise here when 
some observations have no neighbours in a given bin - should one adjust 
the values used to calculate E(I) and var(I)? This is in correlog() in 
ncf, and to a certain extent in pgirmess.

Another view is that the first order set of neighbours should be raised to 
higher orders irrespective of how the set was defined: i and j are first 
order neighbours, i and k are second order neighbours if j and k are first 
order neighbours. This isn't quite matrix powering, because if you are 
already a first order neighbour, you can't be a second order as well 
(discussed in detail in Cliff & Ord 1981, pp. 118-122). See also ?nblag to 
see what is going on. correlog() in pgirmess uses nclass.Sturges() to 
choose the number of bins, but does not fully protect against bins with 
no-neighbour observations.

>
> After deciding the most appropriate neighbourhood distance (1600 km - 
> mine's a global dataset), I created a list of weights via nb2listw that 
> is an inverse function of distance (1/distance). I then performed SEVM 
> using the list of weights, using the brute force ME() algorithm to 
> extract eigenvectors that reduce SAC.
>
> I plan to report the Moran's I value given from moran.test() on both my 
> (non- spatial) GLM and Spatial GLM to prove that the spatial model has 
> reduced autocorrelation.
>
> In addition to that, I plan to show the correlograms of the model 
> residuals both non-spatial and spatial GLMs.
>
> I would like to ask which function is a better choice for showing the 
> correlograms. Should I use correlog{ncf} or sp.correlogram{spdep}. From 
> what I know, calculating Moran's I require definition of a neighbourhood 
> and a specific weighting scheme. Does anyone know what is the default 
> neighbourhood and weighting scheme of correlog()? Is it - if I specify 
> an increment of 100km, then, all points within 0-100, and then 100-200, 
> etc, are considered neighbours with a binary weighting scheme for each 
> distance class?

The ncf correlog() uses many nxn matrices, and computes the bands by:

dkl <- ceiling(dmat/increment)

where dmat is a lower triangle distance matrix, increment is the band 
width, and dkl has the same form as dmat (it says which distance band the 
moran pairs in the lower triangle crossproduct matrix used belong to).

As you can see, the source code is the documentation here.

>
> For sp.correlogram, can I specify the nb object defined by min:0km, 
> max:100km, and use a lag order of, for example 50, to plot the 
> correlogram of my spatial model (which has a neighbourhood distance of 
> 1600 km)?
>
> For both functions, it seems that there is no way to incorporate my 
> inverse- distance weighting scheme that I used in my spatial models. Is 
> this of practical concern if I intend to plot my correlograms?
>
> Lastly I have a side question regarding correlograms. When we see 
> distances of, e.g., 100, 200, 300, etc (the increment or lag distance is 
> 100), on the X-axis of a spatial correlogram, does the point at 200 
> refer to correlations between neighbours of distance 100-200km apart? Or 
> does it include the first 100km as well (i.e., correlations between 
> neighbours of distance 0-200km apart)?

In general, the pairs of distances within that band (or lag order). But 
check the code to be sure.

Roger

>
> Sorry for the long post. Many thanks for reading, I really appreciate 
> it. I know some are really basic questions but I can't find any answers 
> to my questions on google or searching through the list.
>
> Many thanks,
> Xingli
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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