| sample.variogram {georob} | R Documentation |
Computing (Robust) Sample Variograms of Spatial Data
Description
The function sample.variogram computes the
sample (empirical) variogram of a spatial variable by the method-of-moment
and three robust estimators. Both omnidirectional and direction-dependent
variograms can be computed, the latter for observation locations in a
three-dimensional domain. There are summary and plot
methods for summarizing and displaying sample variograms.
Usage
sample.variogram(object, ...)
## Default S3 method:
sample.variogram(object, locations, lag.dist.def,
xy.angle.def = c(0, 180), xz.angle.def = c(0, 180), max.lag = Inf,
estimator = c("qn", "mad", "matheron", "ch"), mean.angle = TRUE, ...)
## S3 method for class 'formula'
sample.variogram(object, data, subset, na.action,
locations, lag.dist.def, xy.angle.def = c(0, 180),
xz.angle.def = c(0, 180), max.lag = Inf,
estimator = c("qn", "mad", "matheron", "ch"), mean.angle = TRUE, ...)
## S3 method for class 'georob'
sample.variogram(object, lag.dist.def,
xy.angle.def = c(0, 180), xz.angle.def = c(0, 180), max.lag = Inf,
estimator = c("qn", "mad", "matheron", "ch"), mean.angle = TRUE, ...)
## S3 method for class 'sample.variogram'
summary(object, ...)
## S3 method for class 'sample.variogram'
plot(x, type = "p", add = FALSE,
xlim = c(0, max(x[["lag.dist"]])),
ylim = c(0, 1.1 * max(x[["gamma"]])), col, pch, lty, cex = 0.8,
xlab = "lag distance", ylab = "semivariance",
annotate.npairs = FALSE, npairs.pos = 3, npairs.cex = 0.7,
legend = nlevels(x[["xy.angle"]]) > 1 || nlevels(x[["xz.angle"]]) > 1,
legend.pos = "topleft", ...)
Arguments
object |
a numeric vector with the values of the response for which
the sample variogram should be computed
( |
locations |
a numeric matrix with the coordinates of the locations
where the response was observed ( |
data |
an optional data frame, list or environment (or another
object coercible by |
subset |
an optional vector specifying a subset of observations to be used for estimating the variogram. |
na.action |
a function which indicates what should happen when the
data contain |
lag.dist.def |
a numeric scalar defining a constant bin
width for grouping the lag distances or a numeric vector with the bounds
of a set of contiguous bins (upper bounds of bins except for the first
element of |
xy.angle.def |
an numeric vector defining angular classes
in the horizontal plane for computing directional variograms.
|
xz.angle.def |
an numeric vector defining angular classes
in the |
max.lag |
a positive numeric defining the largest lag distance for which semi variances should be computed (default no restriction). |
estimator |
a character keyword defining the estimator for computing the sample variogram. Possible values are:
|
mean.angle |
a logical scalar controlling whether the mean lag vector (per
combination of lag distance and angular class) is computed from the mean
angles of all the lag vectors falling into a given class ( |
x |
an object of class |
type, xlim, ylim, xlab, ylab |
see respective arguments of
|
add |
a logical scalar controlling whether a new plot should be
generated ( |
col |
a vector with the colours of plotting symbols for distinguishing semi variances
for angular classes in the |
pch |
a vector with the types of plotting symbols for distinguishing
semi variances for angular classes in the |
lty |
the line type. |
cex |
a numeric with the character expansion factor for plotting symbols. |
annotate.npairs |
a logical scalar controlling whether the plotting symbols should be annotated by the number of data pairs per lag class. |
npairs.pos |
an integer defining the position where text annotation
about number of pairs should be plotted, see
|
npairs.cex |
a numeric defining the character expansion for text annotation about number of pairs. |
legend |
a logical scalar controlling whether a
|
legend.pos |
a character keyword defining where to place the
legend, see |
... |
additional arguments passed to
|
Details
The angular classes in the x-y- and x-z-plane are
defined by vectors of ascending angles on the half circle. The ith
angular class is defined by the vector elements, say l and u,
with indices i and i+1. A lag vector belongs to the
ith angular class if its azimuth (or angle from zenith), say
\varphi, satisfies l < \varphi \leq u.
If the first and the last element of xy.angle.def or
xz.angle.def are equal to 0 and 180 degrees,
respectively, then the first and the last angular class are
“joined”, i.e., if there are K angles, there will be only
K-2 angular classes and the first class is defined by the interval
( xy.angle.def[K-1]-180, xy.angle.def[2] ] and the last
class by ( xy.angle.def[K-2], xy.angle.def[K-1]].
Value
All methods of the generic function sample.variogram
return an object of class sample.variogram, which
is a data frame with the following components:
lag.dist | the mean lag distance of the lag class, |
xy.angle | the angular class in the x-y-plane, |
xz.angle | the angular class in the x-z-plane, |
gamma | the estimated semi-variance of the lag class, |
npairs | the number of data pairs in the lag class, |
lag.x | the x-component of the mean lag vector of the lag class, |
lag.x | the y-component of the mean lag vector of the lag class, |
lag.z | the z-component of the mean lag vector of the lag class. |
The method summary.sample.variogram returns an object of class
summary.sample.variogram which is list with the components
log.dist, npairs, xy.angle and xz.angle, see
description for object of class sample.variogram above. There is a
print method for objects of class summary.sample.variogram
which invisibly returns the object unchanged.
The method plot.sample.variogram is called for its side effects and
invisibly returns the object sample.variogram unchanged.
Author(s)
Andreas Papritz papritz@retired.ethz.ch.
References
Cressie, N. and Hawkins, D. M. (1980) Robust Estimation of the Variogram: I. Mathematical Geology, 12, 115–125, doi:10.1007/BF01035243.
Dowd, P. A. (1984) The variogram and Kriging: Robust and resistant estimators. In Geostatistics for Natural Resources Characterization, Verly, G., David, M., Journel, A. and Marechal, A. (Eds.) Dordrecht: D. Reidel Publishing Company, Part I, 1, 91–106, doi:10.1007/978-94-009-3699-7.
Genton, M. (1998) Highly Robust Variogram Estimation. Mathematical Geology, 30, 213–220, doi:10.1023/A:1021728614555.
See Also
georobPackage for a description of the model and a brief summary of the algorithms;
georob for (robust) fitting of spatial linear models;
georobObject for a description of the class georob;
profilelogLik for computing profiles of Gaussian likelihoods;
plot.georob for display of RE(ML) variogram estimates;
control.georob for controlling the behaviour of georob;
georobModelBuilding for stepwise building models of class georob;
cv.georob for assessing the goodness of a fit by georob;
georobMethods for further methods for the class georob;
predict.georob for computing robust Kriging predictions;
lgnpp for unbiased back-transformation of Kriging prediction
of log-transformed data;
georobSimulation for simulating realizations of a Gaussian process
from model fitted by georob.
Examples
data(wolfcamp)
## omnidirectional sample variogram
r.sv.iso <- sample.variogram(pressure~1, data = wolfcamp,
locations = ~x + y, lag.dist.def = seq(0, 200, by = 15))
plot(r.sv.iso, type = "l")
## direction-dependent sample variogram
r.sv.aniso <- sample.variogram(pressure~1, data = wolfcamp,
locations = ~x + y, lag.dist.def = seq(0, 200, by = 15),
xy.angle.def = c(0., 22.5, 67.5, 112.5, 157.5, 180.))
plot(r.sv.aniso, type = "l", add = TRUE, col = 2:5)