Learn R Programming

ncf (version 1.1-2)

correlog: Uni- and multivariate spatial correlograms

Description

correlog is the function to estimate spatial (cross-)correlograms. Either univariate or multivariate (time seres) for each site can be used.

Usage

correlog(x, y, z, w = NULL, increment, resamp = 1000, 
latlon = FALSE, na.rm = FALSE, quiet = FALSE)

Arguments

x
vector of length n representing the x coordinates (or longitude; see latlon).
y
vector of length n representing the y coordinates (or latitude).
z
vector of length n or matrix of dimension n x p representing p observation at each location.
w
an optional second variable with idenitical dimension to z (to estimate cross-correlograms).
increment
increment for the uniformly distributed distance classes.
resamp
the number of permutations under the null to assess level of significance.
latlon
if TRUE, coordinates are latitude and longitude.
na.rm
if TRUE, NA's will be dealt with through pairwise deletion of missing values.
quiet
if TRUE the counter is supressed during execution.

Value

  • An object of class "correlog" is returned, consisting of the following components:
  • correlationthe value for the moran (or Mantel) similarity.
  • mean.of.classthe actual average of the distances within each distance class.
  • nlokthe number of pairs within each distance class.
  • x.interceptthe interpolate x.intercept of Epperson (1993).
  • pthe permutation two-sided p-value for each distance-class.
  • corr0if a cross-correlogram is calculated, corr0 gives the empirical cross-correlation at distance zero.

Details

The spatial (cross-)correlogram and Mantel (cross-)correlogram estimates the spatial dependence at discrete distance classes. The regionwide similarity forms the reference line (the zero-line); the x-intercept is thus the distance at which object are no more similar than that expected by-chance-alone across the region. If the data are univariate, the spatial dependence is measured by Moran's I, if it is multivariate it is measured by the centred Mantel statistic. (Use correlog.nc if the non-centered multivariate correlogram is desired). Missing values are allowed -- values are assumed missing at random.

References

Bjornstad, O.N., Ims, R.A. & Lambin, X. (1999) Spatial population dynamics: Analysing patterns and processes of population synchrony. Trends in Ecology and Evolution, 11, 427-431. Bjornstad, O.N. & Falck, W. (2001) Nonparametric spatial covariance functions: estimation and testing. Environmental and Ecological Statistics, 8:53-70. Epperson, B.K. (1993) Recent advances in correlation studies of spatial patterns of genetic variation. Evolutionary Biology, 27, 95-155.

See Also

plot.correlog spline.correlog correlog.nc

Examples

Run this code
#first generate some sample data
    x <- expand.grid(1:20, 1:5)[,1]
    y <- expand.grid(1:20, 1:5)[,2]

#z data from an exponential random field
    z <- cbind(
        rmvn.spa(x=x, y=y, p=2, method="exp"),
        rmvn.spa(x=x, y=y, p=2, method="exp")
        )

#w data from a gaussian random field
    w <- cbind(
        rmvn.spa(x=x, y=y, p=2, method="gaus"),
        rmvn.spa(x=x, y=y, p=2, method="gaus")
        )

#Spatial correlogram 
    fit1 <- correlog(x=x, y=y, z=z[,1], increment=2, resamp=5) 
    plot(fit1)

#Mantel correlogram 
    fit2 <- correlog(x=x, y=y, z=z, increment=2, resamp=5) 
    plot(fit2)

#Mantel cross-correlogram 
    fit3 <- correlog(x=x, y=y, z=z, w=w, increment=2, resamp=5) 
    plot(fit3)

Run the code above in your browser using DataLab