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.
# S3 method for rtop
varMat(object, varMatUpdate = FALSE, fullPred = FALSE, params = list(), ...)
# S3 method for SpatialPolygonsDataFrame
varMat(object, object2 = NULL,...)
# S3 method for SpatialPolygons
varMat(object, object2 = NULL, variogramModel,
overlapObs, overlapPredObs, ...)
# S3 method for list
varMat(object, object2 = NULL, coor1, coor2, maxdist = Inf,
variogramModel, diag = FALSE, sub1, sub2,
debug.level = ifelse(interactive(), 1, 0), ...)
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
.
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
logical; if TRUE, also existing variance matrices will be recomputed, if FALSE, only missing variance matrices will be computed
logical; whether to create the full covariance matrix also for the predictions, mainly used for simulations
a set of parameters, used to modify the default parameters for
the rtop
package, set in getRtopParams
.
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 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:
miminum number of discretization points, in call to
rtopDisc
if necessary
sampling type from areas, in call to
rtopDisc
if necessary
use geostatistical distance for semivariogram matrices
parameter to set jointly gDistEst = gDistPred = gDist
matrix with observations that overlap each other
matrix with observations
and predictionLocations
that overlap each other
coordinates of centroids of object
coordinates of centre-of-gravity of object2
maximum distance between areas for inclusion in semivariogrma matrix
logical; if TRUE only the semivariogram values along the diagonal will be calculated, typical for semivariogram matrix of prediction locations
semivariogram array for subtraction of inner variances of areas
semivariogram array for subtraction of inner variances of areas
debug.level >= 1 will give output for every element
Jon Olav Skoien
Skoien J. O., R. Merz, and G. Bloschl. Top-kriging - geostatistics on stream networks. Hydrology and Earth System Sciences, 10:277-287, 2006.
Skoien, J. O., Bloschl, G., Laaha, G., Pebesma, E., Parajka, J., Viglione, A., 2014. Rtop: An R package for interpolation of data with a variable spatial support, with an example from river networks. Computers & Geosciences, 67.
gDist
if (FALSE) {
library(sf)
rpath = system.file("extdata",package="rtop")
observations = st_read(rpath,"observations")
vmod = list(model = "Ex1", params = c(0.00001,0.007,350000,0.9,1000))
vm = varMat(observations, variogramModel = vmod)
}
Run the code above in your browser using DataLab