Calculate Variogram Cloud

DESCRIPTION:

Calculates all pairwise differences in a random field data set.

USAGE:

variogram.cloud(formula, data=<<see below>>, subset=<<see below>>, 
                na.action=<<see below>>, azimuth=0, tol.azimuth=90, 
                maxdist=<<see below>>, bandwidth=1e+307, 
                FUN=function(zi, zj) (zi - zj)^2/2)) 

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 with no missing values ( NAs). The formula may also contain expressions for the variables, e.g. sqrt(count) or log(age+1). 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.
azimuth
the clockwise direction angle in degrees from North-South. Only pairs of points in this direction plus or minus tol.azimuth will be included in the output.
tol.azimuth
the tolerance angle, in degrees. tol.azimuth greater than or equal to 90 implies the of use all directions.
maxdist
the maximum distance to consider. The default is half the maximum observed distance.
bandwidth
the maximum perpendicular distance to consider.
FUN
a function of two variables that is to be computed. The default function is the contribution to the classical empirical variogram for the pair z[i], z[j].

VALUE:

an object of class "vgram.cloud" that inherits from "data.frame". The columns are:
distance
the distance between the two points.
gamma
the value of FUN for the z[iindex], z[jindex].
iindex
the index into the original data for the first value of the pair.
jindex
the index into the original data for the second value of the pair.

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

DETAILS:

Methods for class "vgram.cloud" include boxplot, plot and identify.

If all directions and distances are included the return object will have n*(n-1)/2 rows where n is the number of observations. This can get very large, even for relatively small n. The argument maxdist can be used to limit the size. Typically values beyond half the maximum distance in the data are not used in estimating the variogram function.

REFERENCES:

Cressie, Noel. (1993). Statistics For Spatial Data, Revised Edition. Wiley, New York.

SEE ALSO:

, , , .

EXAMPLES:

v1 <- variogram.cloud(coal ~ x + y, data=coal.ash) 
plot(v1) 
boxplot(v1)