Re: [R] spatial cross-correlation

From: ONKELINX, Thierry <>
Date: Tue, 01 Apr 2008 11:35:37 +0200

Dear Javier,

It seems to me that you want to calculate cross variograms. You can do that with the gstat package. Have a look at the example in ?gstat

# let's do some manual fitting of two direct variograms and a cross
g <- gstat(id = "ln.zinc", formula = log(zinc)~1, locations = ~x+y,

        data = meuse)
g <- gstat(g, id = "ln.lead", formula = log(lead)~1, locations = ~x+y,

        data = meuse)
# examine variograms and cross variogram:
# enter direct variograms:

g <- gstat(g, id = "ln.zinc", model = vgm(.55, "Sph", 900, .05)) g <- gstat(g, id = "ln.lead", model = vgm(.55, "Sph", 900, .05))
# enter cross variogram:

g <- gstat(g, id = c("ln.zinc", "ln.lead"), model = vgm(.47, "Sph", 900, .03))
# examine fit:

plot(variogram(g), model = g$model, main = "models fitted by eye")
# see also demo(cokriging) for a more efficient approach

g[c("ln.zinc", "ln.lead")]

HTH, Thierry

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
tel. + 32 54/436 185

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: [] Namens
Verzonden: dinsdag 1 april 2008 11:23
Onderwerp: [R] spatial cross-correlation

I cannot find in the R html documentation a way to evaluate cross-correlation in 2D data sets.

I would like to evaluate cross-correlation in a series of moving windows between two maps.

i,e, specify several windows inside the complete 2D spatial matrixes and for each one ofthese windows evaluate the 2D cross-correlation (commonly conducted in the spectral domain).

Thanks in advance and best wishes,

Javier GP mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 01 Apr 2008 - 09:38:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 Apr 2008 - 10:30:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive