| esv | R Documentation |
Compute the empirical semivariogram for varying bin sizes and cutoff values.
esv(
formula,
data,
xcoord,
ycoord,
cloud = FALSE,
robust = FALSE,
bins = 15,
cutoff,
dist_matrix,
partition_factor
)
## S3 method for class 'esv'
plot(x, ...)
formula |
A formula describing the fixed effect structure. |
data |
A data frame or |
xcoord |
Name of the variable in |
ycoord |
Name of the variable in |
cloud |
A logical indicating whether the empirical semivariogram should
be summarized by distance class or not. When |
robust |
A logical indicating whether the robust semivariogram
(Cressie and Hawkins, 1980) is used. The default is |
bins |
The number of equally spaced bins. The default is 15. Ignored if
|
cutoff |
The maximum distance considered. The default is half the diagonal of the bounding box from the coordinates. |
dist_matrix |
A distance matrix to be used instead of providing coordinate names. |
partition_factor |
An optional formula specifying the partition factor. If specified, semivariances are only computed for observations sharing the same level of the partition factor. |
x |
An object from |
... |
Other arguments passed to other methods. |
The empirical semivariogram is a tool used to visualize and model
spatial dependence by estimating the semivariance of a process at varying distances.
For a constant-mean process, the
semivariance at distance h is denoted \gamma(h) and defined as
0.5 * Var(z1 - z2). Under second-order stationarity,
\gamma(h) = Cov(0) - Cov(h), where Cov(h) is the covariance function at distance h. Typically the residuals from an ordinary
least squares fit defined by formula are second-order stationary with
mean zero. These residuals are used to compute the empirical semivariogram.
At a distance h, the empirical semivariance is
1/N(h) \sum (r1 - r2)^2, where N(h) is the number of (unique)
pairs in the set of observations whose distance separation is h and
r1 and r2 are residuals corresponding to observations whose
distance separation is h. The robust version is described by
Cressie and Hawkins (1980). In spmodel, these distance bins actually
contain observations whose distance separation is h +- c,
where c is a constant determined implicitly by bins. Typically,
only observations whose distance separation is below some cutoff are used
to compute the empirical semivariogram (this cutoff is determined by cutoff).
When using splm() with estmethod as "sv-wls", the empirical
semivariogram is calculated internally and used to estimate spatial
covariance parameters.
If cloud = FALSE, a tibble (data.frame) with distance bins
(bins), the average distance (dist), the average semivariance (gamma), and the
number of (unique) pairs (np). If cloud = TRUE, a tibble
(data.frame) with distance (dist) and semivariance (gamma)
for each unique pair.
Cressie, N & Hawkins, D.M. 1980. Robust estimation of the variogram. Journal of the International Association for Mathematical Geology, 12, 115-125.
esv(sulfate ~ 1, sulfate)
plot(esv(sulfate ~ 1, sulfate))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.