gmGeostats (version 0.10-6)

setCgram: gmGeostats Variogram models set up a D-variate variogram models

Description

gmGeostats Variogram models set up a D-variate variogram models

Usage

setCgram(type, nugget = sill * 0, sill, anisRanges, extraPar = 0)

Arguments

type

constant indicating the model of correlation function

nugget

(DxD)-matrix for the nugget effect

sill

(DxD)-matrix for the partial sills of the correlation function

anisRanges

2x2 or 3x3 matrix of ranges (see details)

extraPar

for certain correlation functions, extra parameters (smoothness, period, etc)

Value

an object of class "gmCgram" containing the linear model of corregionalization of the nugget and the structure given.

Details

The argument type must be an integer indicating the model to be used. Some constants are available to make reading code more understandable. That is, you can either write 1, vg.Sph or vg.Spherical, they will all work and produce a spherical model. The same applies for the following models: vg.Gauss=0; vg.Exp=vg.Exponential=2. These constants are available after calling data("variogramModels"). No other model is currently available, but this data object will be regularly updated. The constant vector gsi.validModels contains all currently valid models.

Argument anisRange expects a matrix $M$ such that $$ h^2 = (\mathbf{x}_i-\mathbf{x}_j)\cdot M^{-1}\cdot (\mathbf{x}_i-\mathbf{x}_j)^t $$ is the (square of) the lag distance to be fed into the correlation function.

Examples

Run this code
# NOT RUN {
utils::data("variogramModels") # shortcut for all model constants
v1 = setCgram(type=vg.Gau, sill=diag(2), anisRanges = 3*diag(c(3,1)))
v2 = setCgram(type=vg.Exp, sill=0.3*diag(2), anisRanges = 0.5*diag(2))
vm = v1+v2
plot(vm)
# }

Run the code above in your browser using DataCamp Workspace