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-dimensionsal domain. There are summary and plot
methods for summarizing and displaying sample variograms.sample.variogram(object, ...)
"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, ...)
"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, ...)
"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, ...)
"summary"(object, ...)
"plot"(x, type = "p", add = FALSE, xlim = c(0, max(x[["lag.dist"]])), ylim = c(0, 1.1 * max(x[["gamma"]])), col, pch, 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", ...)sample.variogram.default), a formula, specifying in its left part
the response variable (right part of formula is ignored,
sample.variogram.formula), an object of class georob
(sample.variogram.georob) or an object of class
sample.variogram (summary.sample.variogram).sample.variogram.default) or a
one-sided formula specifying the coordinates
(sample.variogram.formula). The matrix may have an arbitrary
number of columns for an omnidirectional variogram, but at most 3 columns
if a directional variogram is computed.as.data.frame to a data frame)
containing the response variable and the coordinates where the data
was recorded. If not found in data, the variables are taken from
environment(formula), typically the environment from which
sample.variogram is called.NAs. The default is set by the na.action
argument of options, and is na.fail if that is
unset. The factory-fresh default is na.omit.
Another possible value is NULL, no action. Value
na.exclude can be useful.lag.dist.def which is the lower bound of the first bin).xy.angle.def must contain an ascending sequence of azimuth angles
in degrees from north (positive clockwise to south), see Details.
Omnidirectional variograms are computed with the default
c(0,180).xz.angle.def must contain an ascending sequence of angles in
degrees from zenith (positive clockwise to nadir), see
Details. Omnidirectional variograms are computed with the default
c(0,180)."qn": Genton's robust
Qn-estimator (default, Genton, 1998),
"mad": Dowd's robust MAD-estimator (Dowd, 1984),
"matheron": non-robust method-of-moments estimator,
"ch": robust Cressie-Hawkins estimator (Cressie and
Hawkins, 1980).
TRUE,
default) or from the mid-angles of the respective angular classes
(FALSE).sample.variogram.plot.default.FALSE, default) or whether the information should be
added to the current plot (TRUE).text.legend should be plotted.legend for possible values.plot.formula.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 semivariance 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. |
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]].
=>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. Genton, M. (1998) Highly Robust Variogram Estimation. Mathematical Geology, 30, 213--220.
georobIntro for a description of the model and a brief summary of the algorithms;
georob for (robust) fitting of spatial linear models;
fit.variogram.model for fitting variogram models to sample variograms.
data(wolfcamp, package = "geoR")
## fitting an isotropic IRF(0) model
r.sv.iso <- sample.variogram(wolfcamp[["data"]], locations = wolfcamp[[1]],
lag.dist.def = seq(0, 200, by = 15))
## Not run:
# plot(r.sv.iso, type = "l")## End(Not run)
## fitting an anisotropic IRF(0) model
r.sv.aniso <- sample.variogram(wolfcamp[["data"]],
locations = wolfcamp[[1]], lag.dist.def = seq(0, 200, by = 15),
xy.angle.def = c(0., 22.5, 67.5, 112.5, 157.5, 180.))
## Not run:
# plot(r.sv.aniso, type = "l", add = TRUE, col = 2:5)## End(Not run)
Run the code above in your browser using DataLab