Skip to contents

Classical Matheron estimator: half the average squared difference of values within each distance bin.

Usage

morie_spatial_variogram(coords, values, n_bins = 15L, cutoff = NULL)

Arguments

coords

Two-column matrix (or data frame) of coordinates.

values

Numeric vector of observations.

n_bins

Number of distance bins (default 15).

cutoff

Maximum distance considered (default one third of the maximum pairwise distance, the gstat convention).

Value

A data frame with dist (bin centre), gamma (semivariance), and np (pair count per bin).

References

Matheron, G. (1963). Principles of geostatistics. Economic Geology, 58(8), 1246–1266.

Examples

set.seed(1)
coords <- cbind(runif(60, 0, 10), runif(60, 0, 10))
values <- coords[, 1] * 0.5 + rnorm(60, 0, 0.3)
str(morie_spatial_variogram(coords, values), max.level = 1)
#> 'data.frame':	14 obs. of  3 variables:
#>  $ dist : num  0.388 0.647 0.906 1.165 1.424 ...
#>  $ gamma: num  0.0324 0.102 0.1474 0.1758 0.1261 ...
#>  $ np   : int  14 16 25 27 28 43 43 57 48 60 ...