Skip to content
Prev 17933 / 29559 Next

Memory problems with dnearneigh in spdep

I do prefer an affiliation, a real name, and a motivation; a
yahoo or gmail address tells me nothing about what you might be expected
to know. If I (or a list helper) cannot "place" you, it is much harder to
know why you are having problems.

You are also in breach of list rules because you are posting in HTML 
rather than just plain text. Removing the HTML will shorten your posting 
radically.
On Sun, 7 Apr 2013, Empty Empty wrote:

            
Please always include the output of sessionInfo(). Here also include 
summary(r) output.
This is not needed.
nb9333<- dnearneigh(r, 0, 9333)

would work, and would not override longlat=. I assume in fact that r is in 
longlat, and that you would then mean to use a km threshold of 9.333. If 
I'm right, then the memory usage is being complicated by your including 
all observations as neighbours of each observation.

For a 1km grid, a threshold of 9333m means that each of the about 30M 
gridcells has 100 neighbours (rather strong smoothing). Is the threshold 
sensibly chosen? The neighbour object will be 30M by 100 by 4, 1.21e+10 
(12G); the labels of the neighbour object at least the same; the weights 
24G in addition, so nb9333.listw is about 50G. With a more sensible 
threshold (1.5km?), the sizes of the nb9333.listw weights object become 
more tractable, maybe about 5G.

Is any of the data observed on this grid? For localG* (or localG) to make 
any sense, the variable must be observed at this resolution (satellite 
imagery?) - if interpolated, all bets are off.

Finally, the output involves so many multiple comparisons that no 
statistical inference is possible under normal assumptions - where is the 
3.886 coming from - is this an attempt to adjust for multiple comparisons?

I'm unsure why anyone would do this, as you could use standard filtering 
techniques on imaging data. The raster package also has functions for 
computing the local Moran and Geary measures on RasterLayer objects.

Hope this clarifies,

Roger