rtopFitVariogram | R Documentation |
rtopFitVariogram will fit a variogram model to the estimated binned variogram or cloud variogram of data with an areal support.
## S3 method for class 'rtop'
rtopFitVariogram(object, params = list(), iprint = 0, ...)
## S3 method for class 'SpatialPolygonsDataFrame'
rtopFitVariogram(object, params=list(), ...)
## S3 method for class 'SpatialPointsDataFrame'
rtopFitVariogram(object, params=list(), ...)
## S3 method for class 'rtopVariogram'
rtopFitVariogram(object, observations, dists = NULL,
params=list(), mr = FALSE, aOver = NULL, iprint = 0, ...)
## S3 method for class 'rtopVariogramCloud'
rtopFitVariogram(object, observations, dists = NULL,
aOver = NULL, params=list(), mr = FALSE, iprint = 0, ...)
object |
object of class The object can also be of class |
observations |
the observations, passed as a Spatial*DataFrame object, if
object is an |
params |
a set of parameters, used to modify the default parameters for
the |
dists |
either a matrix with geostatistical distances (created by a call
to the function |
mr |
logical; defining whether the function should return a list with discretized elements and geostatistical distances, even if it was not called with an rtop-object as argument. |
aOver |
a matrix with the overlapping areas of the observations, used for computation of the nugget effect. It will normally be recomputed by the function if it is NULL and necessary |
iprint |
print flag that is passed to |
... |
Other parameters to functions called from |
The function creates an object with the fitted
variogram Model (variogramModel
)
and a
data.frame
(varFit
) with the
differences between the sample semivariances and the regularized semivariances.
If mr
= TRUE, the function also returns other objects (discretized elements
and geostatistical distances, if created) as a part of the returned object.
If the function is called with an rtop-object as argument, it will return an
rtop-object with variogramModel
and varFit
added to the object,
in addition to other objects created.
There are several options for fitting of the variogramModel, where the parameters
can be set in params
, which is a list of parameters for modification
of the default parameters of the rtop-package given in a call to
getRtopParams
. The first choice is between individual fitting and binned
fitting. This is based on the type of variogram submitted, individual fitting is done
if a cloud variogram (of class rtopVariogramCloud
) is passed as argument,
and binned fitting if the submitted variogram is of class rtopVariogram
.
If the function is called with an object of class rtop
, having both
variogram
and variogramCloud
among its arguments, the variogram
model is fitted to the variogram which is consistent with the parameter cloud
.
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. and G. Bloschl. Spatio-Temporal Top-Kriging of Runoff Time Series. Water Resources Research 43:W09419, 2007.
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.
rpath = system.file("extdata",package="rtop")
library(sf)
observations = st_read(rpath, "observations")
predictionLocations = st_read(rpath,"predictionLocations")
# Create a column with the specific runoff:
observations$obs = observations$QSUMMER_OB/observations$AREASQKM
# Setting some parameters
params = list(gDist = TRUE, cloud = FALSE)
# Create a column with the specific runoff:
observations$obs = observations$QSUMMER_OB/observations$AREASQKM
# Build an object
rtopObj = createRtopObject(observations,predictionLocations,
params = params)
# Fit a variogram (function also creates it)
rtopObj = rtopFitVariogram(rtopObj)
rtopObj$variogramModel
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.