Re: [R] spatial cross-correlation

From: ONKELINX, Thierry <Thierry.ONKELINX_at_inbo.be>
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

libary(gstat)
data(meuse)
# let's do some manual fitting of two direct variograms and a cross
variogram
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:
plot(variogram(g))
# 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["ln.zinc"]
g["ln.lead"]
g[c("ln.zinc", "ln.lead")]
g[1]
g[2]

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
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx_at_inbo.be
www.inbo.be

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: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] Namens jgarcia_at_ija.csic.es
Verzonden: dinsdag 1 april 2008 11:23
Aan: r-help_at_r-project.org
Onderwerp: [R] spatial cross-correlation

Hi;
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




R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive