gmGeostats (version 0.10-6)

gsi.EVario2D: Empirical variogram or covariance function in 2D

Description

compute the empirical variogram or covariance function in a 2D case study

Usage

gsi.EVario2D(
  X,
  Z,
  Ff = rep(1, nrow(X)),
  maxdist = max(dist(X[sample(nrow(X), min(nrow(X), 1000)), ]))/2,
  lagNr = 15,
  lags = seq(from = 0, to = maxdist, length.out = lagNr + 1),
  azimuthNr = 4,
  azimuths = seq(from = 0, to = 180, length.out = azimuthNr + 1)[1:azimuthNr],
  maxbreadth = Inf,
  minpairs = 10,
  cov = FALSE
)

Arguments

X

matrix of Nx2 columns with the geographic coordinates

Z

matrix or data.frame of data with dimension (N,Dv)

Ff

for variogram, matrix of basis functions with nrow(Ff)=N (can be a N-vector of 1s); for covariance function, a (N,Dv)-matrix or a Dv-vector giving the mean values

maxdist

maximum lag distance to consider

lagNr

number of lags to consider

lags

if maxdist and lagNr are not specified, either: (a) a matrix of 2 columns giving minimal and maximal lag distance defining the lag classes to consider, or (b) a vector of lag breaks

azimuthNr

number of azimuths to consider

azimuths

if azimuthNr is not specified, either: (a) a matrix of 2 columns giving minimal and maximal azimuth defining the azimuth classes to consider, or (b) a vector of azimuth breaks

maxbreadth

maximal breadth (in lag units) orthogonal to the lag direction

minpairs

minimal number of pairs falling in each class to consider the calculation sufficient; defaults to 10

cov

boolean, is covariance (TRUE) or variogram (FALSE) desired? defaults to variogram

Value

An empirical variogram for the provided data. NOTE: avoid using directly gsi.* functions! They represent either internal functions, or preliminary, not fully-tested functions. Use variogram instead.

See Also

Other gmEVario functions: as.gmEVario(), ndirections(), plot.gmEVario(), variogramModelPlot()

Examples

Run this code
# NOT RUN {
library(gstat)
data("jura", package = "gstat")
X = as.matrix(jura.pred[,1:2])
Z = as.matrix(jura.pred[,c("Zn","Cd","Pb")])
vge = gsi.EVario2D(X,Z)
dim(vge)
dimnames(vge)
class(vge["gamma",1])
dim(vge["gamma",1][[1]])
vge["npairs",1]
vge["lags",1]
# }

Run the code above in your browser using DataLab