variog: cost-based empirical variogram

Description Usage Arguments Examples

Description

All the arguments work as in variog, except the additional argument dists.mat, which takes a symmetric matrix of distances between observation locations

Usage

1
2
3
4
5
6
7
variog(geodata, coords = geodata$coords, data = geodata$data,
  uvec = "default", breaks = "default", trend = "cte", lambda = 1,
  option = c("bin", "cloud", "smooth"), estimator.type = c("classical",
  "modulus"), nugget.tolerance, max.dist, pairs.min = 2, bin.cloud = FALSE,
  direction = "omnidirectional", tolerance = pi/8,
  unit.angle = c("radians", "degrees"), angles = FALSE, dists.mat, messages,
  ...)

Arguments

geodata

a list containing element coords as described next. Typically an object of the class "geodata" - a geoR data-set. If not provided the arguments coords must be provided instead.

coords

an n x 2 matrix containing coordinates of the n data locations in each row. Defaults to geodata$coords, if provided.

data

a vector or matrix with data values. If a matrix is provided, each column is regarded as one variable or realization. Defaults to geodata$data, if provided.

uvec

a vector with values used to define the variogram binning. Only used when option = "bin". See DETAILS below for more details on how to specify the bins.

breaks

a vector with values to define the variogram binning. Only used when option = "bin". See DETAILS below for more details on how to specify the bins.

trend

specifies the mean part of the model. See documentation of trend.spatial for further details. Defaults to "cte".

lambda

values of the Box-Cox transformation parameter. Defaults to 1 (no transformation). If another value is provided the variogram is computed after transforming the data. A case of particular interest is lambda = 0 which corresponds to log-transformation.

option

defines the output type: the options "bin" returns values of binned variogram, "cloud" returns the variogram cloud and "smooth" returns the kernel smoothed variogram. Defaults to "bin".

estimator.type

"classical" computes the classical method of moments estimator. "modulus" returns the variogram estimator suggested by Hawkins and Cressie (see Cressie, 1993, pg 75). Defaults to "classical".

nugget.tolerance

a numeric value. Points which are separated by a distance less than this value are considered co-located. Defaults to zero.

max.dist

a numerical value defining the maximum distance for the variogram. Pairs of locations separated for distance larger than this value are ignored for the variogram calculation. If not provided defaults takes the maximum distance among all pairs of data locations.

pairs.min

a integer number defining the minimum numbers of pairs for the bins. For option = "bin", bins with number of pairs smaller than this value are ignored. Defaults to NULL.

bin.cloud

logical. If TRUE and option = "bin" the cloud values for each class are included in the output. Defaults to FALSE.

direction

a numerical value for the directional (azimuth) angle. This used to specify directional variograms. Default defines the omnidirectional variogram. The value must be in the interval [0, pi] radians ([0, 180] degrees).

tolerance

numerical value for the tolerance angle, when computing directional variograms. The value must be in the interval [0, pi/2] radians ([0, 90] degrees). Defaults to pi/8.

unit.angle

defines the unit for the specification of angles in the two previous arguments. Options are "radians" and "degrees", with default to "radians".

angles

Logical with default to FALSE. If TRUE the function also returns the angles between the pairs of points (unimplemented).

dists.mat

n x n symmetric matrix with cost-based distances between observations

messages

logical. Indicates whether status messages should be printed on the screen (or output device) while the function is running.

...

arguments to be passed to the function ksmooth, if option = "smooth".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## geodata structure with transformed covariates
   data(noise)
if (require(sp)) {
   covarnames=sapply(1:3, function(x) paste("d2TV", x, sep=""))
   obs.df <- data.frame(Leq=obs$Leq,
                         1/(1+(as.data.frame(obs)[covarnames]/20)^2))
   obs.gd <- as.geodata(cbind(coordinates(obs), obs.df),
                        data.col="Leq",
                        covar.col=c('d2TV1','d2TV2','d2TV3'))

   ## compute euclidean and cost-based empirical variograms
   vg.std <- variog(obs.gd, trend=~d2TV1*(d2TV2+d2TV3))
   vg.dmat <- variog(obs.gd, trend=~d2TV1*(d2TV2+d2TV3), dists.mat=dd.distmat)

   ## plot and compare empirical variograms
   plot(vg.std, type = 'l', col = 'darkred',
        main = 'Euclidean (red) vs. cost-based (gray) empirical variograms')
   lines(vg.dmat, type = 'l', col = 'darkgray')
}

famuvie/geoRcb documentation built on May 16, 2019, 10:04 a.m.