Variogram.default.Rd
This method function calculates the semi-variogram for an arbitrary
vector object
, according to the distances in distance
.
For each pair of elements \(x,y\) in object
, the
corresponding semi-variogram is \((x-y)^2/2\). The semi-variogram is
useful for identifying and modeling spatial correlation structures in
observations with constant expectation and constant variance.
# Default S3 method
Variogram(object, distance, ...)
a numeric vector with the values to be used for calculating the semi-variogram, usually a residual vector from a fitted model.
a numeric vector with the pairwise distances
corresponding to the elements of object
. The order of the
elements in distance
must correspond to the pairs
(1,2), (1,3), ..., (n-1,n)
, with n
representing the
length of object
, and must have length n(n-1)/2
.
some methods for this generic require additional arguments. None are used in this method.
a data frame with columns variog
and dist
representing,
respectively, the semi-variogram values and the corresponding
distances. The returned value inherits from class Variogram
.
Cressie, N.A.C. (1993), "Statistics for Spatial Data", J. Wiley & Sons.
fm1 <- lm(follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time), Ovary,
subset = Mare == 1)
Variogram(resid(fm1), dist(1:29))[1:10,]
#> variog dist
#> 1 10.098577567 1
#> 2 0.003014275 2
#> 3 3.876160700 3
#> 4 15.892707794 4
#> 5 37.412782986 5
#> 6 23.258010769 6
#> 7 13.180732207 7
#> 8 21.562480671 8
#> 9 0.003450613 9
#> 10 0.923619345 10