codisp: Codispersion Coefficient

View source: R/codisp.R

codispR Documentation

Codispersion Coefficient

Description

Computes the codispersion coefficient between two spatial variables for a given number of classes for the lag distance.

Usage

  codisp(x, y, coords, nclass = 13)

Arguments

x

an n-dimensional vector of data values.

y

an n-dimensional vector of data values.

coords

an n-by-2 matrix containing coordinates of the n data locations in each row.

nclass

a single number giving the number of cells for the codispersion coefficient. The default is 13. If this argument is NULL Sturges' formula is used.

Details

The procedure computes the codispersion coefficient for two spatial sequences defined on general (non-rectangular) grids. First, a given number of bins are constructed for the lag distance. Then the codispersion is computed for each bin.

Value

A list with class "codisp" containing the following components:

coef

a vector of size nclass containing the values of the codispersion coefficient.

upper.bounds

upper bounds of the intervals constructed to compute the codispersion coefficient.

card

number of elements in each interval generated to compute the codispersion coefficient.

The function plot can be used to obtain a graph of the codispersion coefficient versus the lag distance.

References

Cuevas, F., Porcu, E., Vallejos, R. (2013). Study of spatial relationships between two sets of variables: A nonparametric approach. Journal of Nonparametric Statistics 25, 695-714.

Matheron, G. (1965), Les Variables Regionalisees et leur Estimation. Masson, Paris.

Rukhin, A., Vallejos, R. (2008), Codispersion coefficient for spatial and temporal series. Statistics and Probability Letters 78, 1290-1300.

Vallejos, R. (2008). Assessing the association between two spatial or temporal sequences. Journal of Applied Statistics 35, 1323-1343.

Examples

# Murray Smelter site dataset
data(murray)

# defining the arsenic (As) and lead (Pb) variables from the murray dataset
x <- murray$As
y <- murray$Pb

# extracting the coordinates from Murray dataset
coords <- murray[c("xpos","ypos")]

# computing the codispersion coefficient
z <- codisp(x, y, coords)
z

## plotting the codispersion coefficient vs. the lag distance
plot(z)

# Comovement between two time series representing the monthly deaths
# from bronchitis, emphysema and asthma in the UK for 1974-1979
x <- mdeaths
y <- fdeaths
coords <- cbind(1:72, rep(1,72))
z <- codisp(x, y, coords)

# plotting codispersion and cross-correlation functions
par(mfrow = c(1,2))
ccf(x, y, ylab = "cross-correlation", max.lag = 20)
plot(z)

SpatialPack documentation built on Sept. 29, 2024, 5:06 p.m.