Empirical Correlogram and Covariogram

DESCRIPTION:

Computes the empirical correlogram or covariogram for two dimensional spatial data. Multiple correlograms and covariograms for different directions can be computed.

USAGE:

correlogram(formula, data=<<see below>>, subset=<<see below>>,
          na.action=<<see below>>, lag=<<see below>>, nlag=20,
          tol.lag=lag/2, azimuth=0, tol.azimuth=90, bandwidth=1e21,
          maxdist=<<see below>>, minpairs=6)
covariogram(formula, data=<<see below>>, subset=<<see below>>,
          na.action=<<see below>>, lag=<<see below>>, nlag=20,
          tol.lag=lag/2, azimuth=0, tol.azimuth=90, bandwidth=1e21,
          maxdist=<<see below>>, minpairs=6)

REQUIRED ARGUMENTS:

formula
formula defining the response and the predictors. In general, its form is: z ~ x + y The z variable is a numeric response. Variables x and y are the locations. All variables in the formula must be vectors of equal length. The formula may also contain expressions for the variables, e.g. sqrt(count), log(age+1) or I(2*x). (The I() is required since the * operator has a special meaning on the right side of a formula. The right hand side may also be a call to the loc function e.g. loc(x,y). The loc function can be used to correct for geometric anisotropy, see the loc help file.

OPTIONAL ARGUMENTS:

data
an optional data frame in which to find the objects mentioned in formula.
subset
expression saying which subset of the rows of the data should be used in the fit. This can be a logical vector (which is replicated to have length equal to the number of observations), or a numeric vector indicating which observation numbers are to be included, or a character vector of the row names to be included.
na.action
a function to filter missing data. This is applied to the model.frame after any subset argument has been used. The default (with na.fail) is to create an error if any missing values are found. A possible alternative is na.omit, which deletes observations that contain one or more missing values.
lag
a numeric value, the width of the lags. If missing, lag is set to maxdist / nlag.
nlag
an integer, the maximum number of lags to calculate.
tol.lag
a numeric value, the distance tolerance.
azimuth
a vector of direction angles in degrees, measured from North-South. A separate correlogram will be estimated for each direction.
tol.azimuth
angle tolerance in degrees. A tol.azimuth of 90 or greater (the default) results in an omnidirectional correlogram.
bandwidth
the maximum bandwidth, the deviation from the direction orthogonal to the direction angle.
maxdist
the maximum distance to include in the returned output. The default is half the maximum distance in the data.
minpairs
the minimum number of pairs of points (minimum value for np) that must be used in calculating a correlogram or covariogram value. If np is less than minpairs then that value is dropped from the result.

VALUE:

an object of class "correlogram" or "covariogram" that inherits from " variogram" and "data.frame" with columns:
distance
the average distance for pairs in the lag.
rho
the correlogram estimate (if correlogram was called).
cov
the covariogram estimate (if covariogram was called).
np
the number of pairs in each lag.
azimuth
a factor denoting the angular direction.

The return object has an attribute call with an image of the call that produced the object.

DETAILS:

There are plot methods for classes "correlogram" and "covariogram". The print and summary methods for class "variogram" can be used through inheritance.

The covariogram is a measure of spatial covariance as a function of distance. The correlogram is a standardized covariogram where the values are between -1 and 1. These functions make a call to the function variogram with the argument type set to "correlogram" or "covariogram". The computations are based on a modified version of the gamv2 subroutine from GSLIB (Deutsch and Journel, 1992).

REFERENCES:

Cressie, Noel A. C. (1993). Statistics for Spatial Data, Revised Edition. Wiley, New York.

Deutsch, Clayton V. and Journel, Andre G. (1992). GSLIB Geostatistical Software Library and User's Guide. Oxford University Press, New York.

SEE ALSO:

, , .

EXAMPLES:

# an omnidirectional correlogram
c1 <- correlogram(log(tcatch+1) ~ lat + long, data=scallops)
plot(c1)
# correlograms in 0, 45, 90 and 135 degrees directions
c2 <- correlogram(log(tcatch+1) ~ loc(lat,long), data=scallops,
                azimuth=c(0,45,90,135), tol.azimuth=22.5)
plot(c2)