Plot variogram fitted to data with support

Share:

Description

The function will create diagnostic plots for analysis of the variograms fitted to sample variograms of data with support

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'rtop'
checkVario(object, acor = 1, log = "xy", cloud = FALSE, 
                          gDist = TRUE, curveSmooth = FALSE, params = list(), ...) 

## S3 method for class 'rtopVariogramModel'
checkVario(object, 
           sampleVariogram = NULL, observations = NULL, 
           areas = NULL, dists = NULL, acomp = NULL,  
           params = list(), compVars = list(), acor = 1, 
           log = "xy", legx = NULL, legy = NULL, 
           plotNugg = TRUE, curveSmooth = FALSE, ...) 

Arguments

object

either: object of class rtop (see rtop-package), or an object of type
rtopVariogram

acor

unit correction factor in the key, e.g. to see numbers more easily interpretable for large areas. As an example, ucor = 0.000001 when area is given in square meters and should rather be shown as square kilometers. Note that this parameter also changes the value of the nugget to the new unit.

log

text variable for log-plots, default to log-log "xy", can otherwise be set to "x", "y" or ""

cloud

logical; whether to look at the cloud variogram instead of the binned variogram

gDist

logical; whether to use ghosh-distance for semivariogram regularization instead of full integration of the semivariogram

sampleVariogram

a sample variogram of the data

observations

a set of observations

areas

either an array of areas that should be used as examples, or the number of areas per order of magnitude (similar to the parameter amul of the standard parameters, see getRtopParams. amul from rtopObj or from the standard parameter set will be used if not defined here.

dists

either an array of distances that should be used as examples, or the number of distances per order of magnitude(similar to the parameter amul of the standard parameters, see getRtopParams. amul from rtopObj or from the standard parameter set will be used if not defined here.

acomp

either a matrix with the area bins that should be visualized, or a number giving the number of pairs to show. If a sample variogram is given, the acomp pairs with highest number of pairs will be used

curveSmooth

logical or numerical; describing whether the curves in the last plot should be smoothed or not. If numeric, it gives the degrees of freedom (df) for the splines used for smoothing. See also smooth.spline

params

list of parameters to modify the standard parameters of rtopObj or the default parameters found from getRtopParams

compVars

a list of variograms of gstat-type for comparison, see vgm. The names of the variograms in the list will be used in the key.

legx

x-coordinate of the legend for fine-tuning of position, see x-argument of
legend

legy

y-coordinate of the legend for fine-tuning of position, see y-argument of
legend

plotNugg

logical; whether the nugget effect should be added to the plot or not

...

arguments to lower level functions

Value

The function gives diagnostic plots for the fitted variograms, where the regularized variograms are shown together with the sample variograms and possibly also user defined variograms. In addition, if an rtopObject is submitted, the function will also give plots of the relationship between variance and area size and a scatter plot of the fit of the observed and regularized variogram values. The sizes of the dots are relative to the number of pairs in each group.

Author(s)

Jon Olav Skoien

See Also

rtop-package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
library(rgdal)
library(gstat)
rpath = system.file("extdata",package="rtop")
setwd(rpath)
observations = readOGR(".","observations")
# Create a column with the specific runoff:
observations$obs = observations$QSUMMER_OB/observations$AREASQKM
predictionLocations = readOGR(".","predictionLocations")
params = list(cloud = TRUE, gDist = TRUE)
rtopObj = createRtopObject(observations, predictionLocations, 
                           params = params)

# Fit a variogram (function also creates it)
rtopObj = rtopFitVariogram(rtopObj)
checkVario(rtopObj, 
    compVar = list(first = vgm(5e-6, "Sph", 30000,5e-8), 
                   second = vgm(2e-6, "Sph", 30000,5e-8)))

rtopObj = checkVario(rtopObj, acor = 0.000001, 
          acomp = data.frame(acl1 = c(2,2,2,2,3,3,3,4,4), 
          acl2 = c(2,3,4,5,3,4,5,4,5)))
rtopObj = checkVario(rtopObj, cloud = TRUE, identify = TRUE, 
          acor = 0.000001)

## End(Not run)