RFcovmatrix {RandomFields}R Documentation

Covariance matrix

Description

RFcovmatrix returns the covariance matrix for a set of points;

Usage

RFcovmatrix(model, x, y = NULL, z = NULL, T = NULL, grid, params,
            distances, dim,...)

Arguments

model,params

object of class RMmodel, RFformula or formula; best is to consider the examples below, first.
The argument params is a list that specifies free parameters in a formula description, see RMformula.

x

vector of x coordinates, or object of class GridTopology or raster; for more options see RFsimulateAdvanced.

y,z

optional vectors of y (z) coordinates, which should not be given if x is a matrix.

T

optional vector of time coordinates, T must always be an equidistant vector. Instead of T=seq(from=From, by=By, len=Len), one may also write T=c(From, By, Len).

grid

logical; the function finds itself the correct value in nearly all cases, so that usually grid need not be given. See also RFsimulateAdvanced.

distances,dim

another alternative for the argument x to pass the (relative) coordinates, see RFsimulateAdvanced.

...

for advanced use: further options and control arguments for the simulation that are passed to and processed by RFoptions. If params is given, then ... may include also the variables used in params.

Details

RFcovmatrix returns a covariance matrix. Here, a matrix of coordinates (x) or a vector or a matrix of distances is expected.

RFcovmatrix also allows for variogram models. Then the negative of the variogram matrix is returned.

Value

RFcovmatrix returns a covariance matrix.

Author(s)

Martin Schlather, schlather@math.uni-mannheim.de, http://ms.math.uni-mannheim.de

See Also

RMmodel, RFsimulate, RFfit, RFfctn, RFcalc, RFcov, RFpseudovariogram, RFvariogram.

Examples


##################################################
# Example: get covariance matrix C(x_i,x_j)    
# at given locations x_i, i=1,...,n 
#
# here for an isotropic stationary covariance model
# yields a 4 times 4 covariance matrix of the form
# C(0)   C(5)   C(3)   C(2.5)
# C(5)   C(0)   C(4)   C(2.5)
# C(3)   C(4)   C(0)   C(2.5)
# C(2.5) C(2.5) C(2.5) C(0)

model <- RMexp() # the covariance function C(x,y)=C(r) of this model
#                  depends only on the distance r between x and y
RFcovmatrix(model=model, distances=c(5,3,2.5,4,2.5,2.5), dim=4)



[Package RandomFields version 3.3.7 Index]