Learn R Programming

rtop (version 0.5-5)

varMat: create a semivariogram matrix between a set of locations, or semivariogram matrices between and within two sets of locations

Description

varMat will create a semivariogram matrix between all the supports in a set of locations (observations or prediction locations) or semivariogram matrices between all the supports in one or two sets of locations, and also between them.

Usage

"varMat"(object, varMatUpdate = FALSE, params = list(), ...) "varMat"(object, object2 = NULL,...) "varMat"(object, object2 = NULL, variogramModel, overlapObs, overlapPredObs, ...)
"varMat"(object, object2 = NULL, coor1, coor2, maxdist = Inf, variogramModel, diag = FALSE, sub1, sub2, debug.level = 1, ...)

Arguments

object
either: 1) an object of class rtop (see rtop-package) or 2) a SpatialPolygonsDataFrame, or SpatialPolygons, or 3) a matrix with geostatistical distances (see gDist or 4) a list with discretized supports
varMatUpdate
logical; if TRUE, also existing variance matrices will be recomputed, if FALSE, only missing variance matrices will be computed
params
a set of parameters, used to modify the standard parameters for the rtop package, set in getRtopParams.
object2
if object is not an object of class rtop; an object of the same class as object with a possible second set of locations with support
variogramModel
variogramModel to be used in calculation of the semivariogram matrix (matrices)
...
typical parameters to modify from the default parameters of the rtop-package (or modifications of the previously set parameters for the rtop-object), see also getRtopParams. These can also be passed in a list named params, as for the rtop-method. Typical parameters to modify for this function:
  • rresol = 100miminum number of discretization points, in call to rtopDisc if necessary
  • rstype = "rtop"sampling type from areas, in call to rtopDisc if necessary
  • gDistPred = FALSEuse geostatistical distance for semivariogram matrices
  • gDistparameter to set jointly gDistEst = gDistPred = gDist

overlapObs
matrix with observations that overlap each other
overlapPredObs
matrix with observations and predictionLocations that overlap each other
coor1
coordinates of centroids of object
coor2
coordinates of centre-of-gravity of object2
maxdist
maximum distance between areas for inclusion in semivariogrma matrix
diag
logical; if TRUE only the semivariogram values along the diagonal will be calculated, typical for semivariogram matrix of prediction locations
sub1
semivariogram array for subtraction of inner variances of areas
sub2
semivariogram array for subtraction of inner variances of areas
debug.level
debug.level >= 1 will give output for every element

Value

The lower level versions of the function calculates a semivariogram matrix between locations in object or between the locations in object and the locations in object2. The method for object of type rtop calculates semivariogram matrices between observation locations, between prediction locations, and between observation locations and prediction locations, and adds these to object.

See Also

gDist, rtop-package

Examples

Run this code
## Not run: 
# library(rgdal)
# rpath = system.file("extdata",package="rtop")
# observations = readOGR(rpath,"observations")
# gDist = gDist(observations)
# vmod = list(model = "Ex1", params = c(0.00001,0.007,350000,0.9,1000))
# vm = varMat(gDist$gDistObs, variogramModel = vmod)
# ## End(Not run)

Run the code above in your browser using DataLab