CovarianceFct {RandomFields}R Documentation

Basic Covariance And Variogram Models

Description

CovarianceFct returns the values of a covariance function; see Covariance for sophisticated models

Variogram returns the values of a variogram model

Usage

Covariance(x, y=NULL, model, param=NULL, dim=ifelse(is.matrix(x),ncol(x),1),
               Distances, fctcall=c("Cov", "Variogram", "CovMatrix"))
CovarianceFct(...)
CovMatrix(...)

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

Arguments

x

vector or (n x \code{dim})-matrix. In particular, if the model is isotropic or dim=1 then x is a vector.

y

second vector or matrix in case of non-stationary covariance functions

model

for basic models, model is one of the names given in the Details.

param

The simplest form of param is the vector param=c(mean,variance,nugget,scale,...), in this order;
The dots ... stand for additional parameters of the model, e.g. the smoothing parameter in the whittle model. Within this function mean is not interpreted and can take an arbitrary value.

dim

dimension of the space in which the model is applied

Distances

for covariance matrices, the lower triangular part of the distance matrix can be given instead of the values x themselves

fctcall

internal. This parameter should not be considered by the user

...

The function CovarianceFct is identical to the function Covariance.

Details

Here, only the basic, isotropic models are listed; see sophisticated models for nonisotropic and hyper models.

See GetModel for commands in R to get information about implemented models and currently used ones.

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

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

variance * cov( (.)/scale).

The parameters can be passed by the vector param, param=c(mean, variance, nugget, scale, ...). Here ‘...’ stands for additional parameters such as ν in the whittle model. In case a model has several parameters, as in hyperbolic, the parameters must be given in the sequence they are explained aboved. However, it is strongly recommended to use the list notation explained in sophisticated. The list definition available in RandomFields V 1.x, is depreciated!

For a given covariance function cov the variogram γ equals

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

Note:

Value

CovarianceFct returns a vector of values of the covariance function.

Variogram returns a vector of values of the variogram model.

CovMatrix return a covariance matrix. Here a matrix of of coordinates (x) or a vector or a matrix of Distances is expected. CovMatrix allows also for variogram models. Then negative of variogram matrix is returned.

Author(s)

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

References

Overviews:

Cauchy models, generalisations and extensions

Dagum model

Generalised fractal Brownian motion

Gneiting's models

Holeeffect model

Hyperbolic model

fractalB

genB

lgd

Power model

See Also

sophisticated, EmpiricalVariogram, GetModel, 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", param=c(NA,2,1,5,0.5)))
plot(x, cv)


## (2) above model in the very general list definition
model <- list("+",
              list("$", var=2, scale=5, list("bessel", 0.5)),
              list("nugget"))
cv <- CovarianceFct(x, model=model)
points(x, cv, col="red", pch=20) ## no differnce to first



## (3) nested model definition
## this kind of definiton models is depreciated from Version 2.0 on
cv <- CovarianceFct(x, model="bessel",
                  param=rbind(c(2, 5, 0.5), c(1, 0, 0)))
points(x, cv, col="blue", pch=20, cex=0.5) 
 

## (4) anisotropic notation
 model <- list("+",
               list("$", var=2, aniso=as.matrix(0.2),
                    list("bessel", nu=0.5)
                   ),
               list("nugget")
              ) 
cv <- CovarianceFct(as.matrix(x), model=model)
points(x, cv, col="green", pch=4) 
 


## Depreciated list defintions in Version 1.x
## this way of defining a model still works, but
## is not supported anymore
## (isotropic version)
model <- list(list(model="bessel", var=2, kappa=0.5, scale=5),
              "+",
              list(model="nugget", var=1, scale=1))
cv <- CovarianceFct(x, model=model)
points(x, cv, col="black", pch=5) 


[Package RandomFields version 2.0.54 Index]