CovarianceFct {RandomFields}R Documentation

Covariance And Variogram Models

Description

CovarianceFct returns the values of a covariance function

Variogram returns the values of a variogram model

PrintModelList prints the list of currently implemented models including the corresponding simulation methods

GetModelList returns a matrix of currently implemented models and their simulation methods

GetModelNames returns a list of currently implemented models

Usage

CovarianceFct(x, model, param, dim=ifelse(is.matrix(x),ncol(x),1),
              fctcall="Covariance")

Variogram(x, model, param, dim=ifelse(is.matrix(x),ncol(x),1))

PrintModelList()

GetModelList(abbr=TRUE)

GetModelNames()

Arguments

x vector or (n x dim)-matrix. In particular, if the model is isotropic or dim=1 then x is a vector.
model character or list; if character then name of the covariance function or variogram model - see below, or type PrintModelList() for all options; see Details for the definition of the model by a list.
param vector or matrix of parameters or missing, see Details and Examples; The simplest form is that param is vector of the form param=c(NA,variance,nugget,scale,...), in this order;
The dots ... stand for additional parameters of the model.
dim dimension of the space in which the model is applied
fctcall this parameter should not be changed by the user
abbr logical or numerical. If TRUE the names for the methods are abbreviated. If numerical, abbr gives the number of letters.

Details

The implemented models are in standard notation for a covariance function (variance 1, nugget 0, scale 1) and for positive real arguments x (and t):

Let cov be a model given in standard notation. Then the covariance model applied with arbitrary variance and scale equals

variance * cov( (.)/scale).

For a given covariance function cov the variogram gamma equals

gamma(x) = cov(0) - cov(x).

Note that the value of the covariance function or variogram depends also on RFparameters()$PracticalRange. If the latter is TRUE and the covariance model is isotropic then the covariance function is internally rescaled such that cov(1)~=0.05 for standard parameters (scale=1).

The model and the parameters can be specified by three different forms; the first ‘standard’ form allows for the specification of the covariance model as given above for an isotropic random field. The second form defines isotropic nested models using matrices. The third form allows for defining anisotropic and/or space-time models using lists; here any basic models can arbitrarily be combined by multiplication and summation.

Value

CovarianceFct returns a vector of values of the covariance function.
Variogram returns a vector of values of the variogram model.
PrintModelList prints a table of the currently implemented covariance functions and the matching methods. PrintModelList returns NULL.
GetModelNames returns a list of implemented models

Author(s)

Martin Schlather, martin.schlather@math.uni-goettingen.de http://www.stochastik.math.uni-goettingen.de/institute;

Yindeng Jiang jiangyindeng@gmail.com (circulant embedding methods ‘cutoff’ and ‘intrinsic’)

References

Overviews:

Cauchy models, generalisations and extensions

Gneiting's models

Holeeffect model

Hyperbolic model

Iaco-Cesare model

lgd

Ma-Stein model

nsst

Power model

fractalB

See Also

EmpiricalVariogram, GetPracticalRange, parameter.range, RandomFields, RFparameters, ShowModels.

Examples

 PrintModelList()
 x <- 0:100

 # the following five model definitions are the same!
 ## (1) very traditional form
 (cv <- CovarianceFct(x, model="bessel", c(NA,2,1,5,0.5)))

 ## (2) traditional form in list notation
 model <- list(model="bessel", param=c(NA,2,1,5,0.5))
 cv - CovarianceFct(x, model=model)

 ## (3) nested model definition
 cv - CovarianceFct(x, model="bessel",
                    param=cbind(c(2, 5, 0.5), c(1, 0, 0)))

 #### most general notation in form of lists
 ## (4) isotropic notation 
 model <- list(list(model="bessel", var=2, kappa=0.5, scale=5),
               "+",
               list(model="nugget", var=1))
 cv - CovarianceFct(x, model=model)
              
 ## (5) anisotropic notation
 model <- list(list(model="bessel", var=2, kappa=0.5, aniso=0.2), 
               "+",
               list(model="nugget", var=1, aniso=1))
 cv - CovarianceFct(as.matrix(x), model=model)

 # The model gneitingdiff was defined in RandomFields v1.0.
 # This isotropic covariance function is valid for dimensions less
 # than or equal to 3 and has two positive parameters.
 # It is a class of models with compact support that allows for
 # smooth parametrisation of the differentiability up to order 6.     
 # The former model `gneitingdiff' must now be coded as
 gneitingdiff <-  function(p){
   list(list(m="gneiting", v=p[2], s=p[6]*p[4]),
       "*",
       list(m="whittle", k=p[5], v=1.0, s=p[4]),
       "+",
       list(m="nugget", v=p[3]))
 }
 # and then 
 param <- c(NA, runif(5,max=10)) 
 CovarianceFct(0:100,gneitingdiff(param))
 ## instead of formerly CovarianceFct(x,"gneitingdiff",param)

 # definition of a hypermodel is more complex
 model <- list(list(model="mastein", var=1,
                    aniso=c(1, -0.5, 0, 0), kappa=c(1, 0.5, 1.5)),
              "(",
              list(model="exp", var=1, aniso=c(0, 0, 0, 1)))
 CovarianceFct(cbind(0:10, 0:10), model=model)


[Package RandomFields version 1.3.41 Index]