Covmatrix {CompRandFld}R Documentation

Spatio-temporal (tapered) Covariance Matrix

Description

The function computes the (tapered) covariance matrix for a spatial (temporal or spatio-temporal) covariance model and a set of spatial (temporal or spatio-temporal) points.

Usage

Covmatrix(coordx, coordy=NULL, coordt=NULL, corrmodel,
          distance="Eucl", grid=FALSE, iskrig=FALSE,
          maxdist=NULL, maxtime=NULL, param ,
          taper=NULL, tapsep=NULL, type="Standard")

Arguments

coordx

A numeric (d x 2)-matrix (where d is the number of spatial sites) giving 2-dimensions of spatial coordinates or a numeric d-dimensional vector giving 1-dimension of spatial coordinates.

coordy

A numeric vector giving 1-dimension of spatial coordinates; coordy is interpreted only if coordx is a numeric vector or grid=TRUE otherwise it will be ignored. Optional argument, the default is NULL then coordx is expected to be numeric a (d x 2)-matrix.

coordt

A numeric vector giving 1-dimension of temporal coordinates. At the moment implemented only for the Gaussian case. Optional argument, the default is NULL then a spatial random field is expected.

corrmodel

String; the name of a correlation model, for the description see the Section Details.

distance

String; the name of the spatial distance. The default is Eucl, the euclidean distance. See FitComposite.

grid

Logical; if FALSE (the default) the data are interpreted as spatial or spatial-temporal realisations on a set of non-equispaced spatial sites (irregular grid). See FitComposite.

iskrig

Logical: the default value is FALSE. It is TRUE if the function is called by the function Kri.

maxdist

Numeric; an optional positive value indicating the marginal spatial compact support. See FitComposite.

maxtime

Numeric; an optional positive value indicating the marginal temporal compact support. See FitComposite.

param

A list of parameter values required for the correlation model. See FitComposite and CorrelationParam.

taper

String; the name of the taper correlation function if type is Tapering, see the Section Details.

tapsep

Numeric; an optional value indicating the separabe parameter in the space-time quasi taper (see Details).

type

String; the type of covariance matrix Standard (the default) or Tapering for tapered covariance matrix

Details

The parameter param is a list including all the parameters of a covariance function model.
In particular, the covariance models share the following paramaters: the sill that represents the common variance of the random field, the nugget that represents the local variation (white noise) at the origin. For each correlation model you can check the list of the specific parameters using CorrelationParam.
Here there is the list of all the implemented space and space-time correlation models. The list of space-time correlation functions includes separable and non-separable models.

Remarks:

Let R(h) be a spatial correlation model given in standard notation. Then the covariance model applied with arbitrary variance and scale equals to:

C(h)=sill +nugget , \quad if \quad h=0


C(h)=sill * R( \frac{h}{scale},...) , \quad if \quad h>0

Similarly if R(h,u) is a spatio-temporal correlation model given in standard notation, then the covariance model is:

C(h,u)=sill +nugget , \quad if \quad h=0,u=0


C(h,u)=sill * R( \frac{h}{scale_s},\frac{u}{scale_t},...) , \quad if \quad h>0 \quad or \quad u>0

Here ‘...’ stands for additional parameters.

Let R(h) be a spatial taper given in standard notation. Then the taper function applied with an arbitrary compact support (maxdist) equals to:

T(h)= R( \frac{h}{maxdist})

Similarly if R(h,u) is a spatio-temporal taper given in standard notation, then the taper function applied with arbitrary compact supports (maxdist, maxtime) equals to:

T(h,u)= R( \frac{h}{maxdist},\frac{u}{maxtime})

Then the tapered covariance matrix is obtained as:

C_{tap}(h,u)= T(h,u)C(h,u)

Value

Returns an object of class CovMat. An object of class CovMat is a list containing at most the following components:

coordx

A d-dimensional vector of spatial coordinates;

coordy

A d-dimensional vector of spatial coordinates;

coordt

A t-dimensional vector of temporal coordinates;

covmatrix

The covariance matrix if type isStandard. An object of class spam if type is Tapering

corrmodel

String: the correlation model;

distance

String: the type of spatial distance;

grid

Logical:TRUE if the spatial data are in a regular grid, otherwise FALSE;

nozero

In the case of tapered matrix the percentage of non zero values in the covariance matrix. Otherwise is NULL.

maxdist

Numeric: the marginal spatial compact support if type is Tapering;

maxtime

Numeric: the marginal temporal compact support if type is Tapering;

namescorr

String: The names of the correlation parameters;

numcoord

Numeric: the number of spatial coordinates;

numtime

Numeric: the number the temporal coordinates;

param

Numeric: The covariance parameters;

tapmod

String: the taper model if type is Tapering. Otherwise is NULL.

spacetime

TRUE if spatio-temporal and FALSE if spatial covariance model;

In the space-time case covmatrix is the covariance matrix of the random vector

Z(s_1,t_1),Z(s_1,t_2),..Z(s_n,t_1),..,Z(s_n,t_m)

for n spatial locatione sites and m temporal instants.

Author(s)

Simone Padoan, simone.padoan@unibocconi.it, http://faculty.unibocconi.it/simonepadoan; Moreno Bevilacqua, moreno.bevilacqua@uv.cl, https://sites.google.com/a/uv.cl/moreno-bevilacqua/home.

References

Bevilacqua, M., Mateu, J., Porcu, E., Zhang, H. and Zini, A. (2010). Weighted composite likelihood-based tests for space-time separability of covariance functions. Statistics and Computing, 20(3), 283-293.

Gaetan, C. and Guyon, X. (2010) Spatial Statistics and Modelling. Spring Verlang, New York.

Gneiting, T. (2002). Nonseparable, stationary covariance functions for space-time data. Journal of the American Statistical Association, 97, 590–600.

Gneiting, T., Genton, M. G. and Guttorp, P. (2007). Geostatistical space-time models, stationarity, separability and full symmetry. In Finkenstadt, B., Held, L. and Isham, V. (eds.), Statistical Methods for Spatio-Temporal Systems, Chapman & Hall/CRC, Boca Raton, pp. 151-175

Schlather, M. (1999) An introduction to positive definite functions and to unconditional simulation of random fields. Technical report ST 99–10, Dept. of Maths and Statistics, Lancaster University

See Also

Kri, RFsim, FitComposite

Examples

library(CompRandFld)
library(spam)

################################################################
###
### Example 1. Covariance matrix associated to
### a Matern correlation model
###
###############################################################

# Define the spatial-coordinates of the points:
x <- runif(500, 0, 2)
y <- runif(500, 0, 2)

matrix1 <- Covmatrix(x, y, corrmodel="matern", param=list(smooth=0.5,
                    sill=1,scale=0.2,mean=0))
dim(matrix1$covmatrix)



################################################################
###
### Example 3. Covariance matrix associated to
### a space-time double exponential correlation model
###
###############################################################

# Define the temporal-coordinates:
times <- c(1,2,3)

# Define correlation model
corrmodel="exp_exp"

# Define covariance parameters
param=list(scale_s=0.3,scale_t=0.5,sill=1,mean=0)

# Simulation of a spatial Gaussian random field:
matrix3 <- Covmatrix(x, y, times, corrmodel=corrmodel,
                     param=param)

dim(matrix3$covmatrix)

################################################################
###
### Example 2. Tapered Covariance matrix associated to
### a Matern correlation model
###
###############################################################

# Define the spatial-coordinates of the points:
#x <- runif(500, 0, 2)
#y <- runif(500, 0, 2)

#matrix2 <- Covmatrix(x, y, corrmodel="matern", param=list(smooth=0.5,
#                    sill=1,scale=0.2,mean=0),maxdist=0.3,taper="Wendland1",
#                    type="Tapering")
# Tapered covariance matrix
#as.matrix(matrix2$covmatrix)[1:15,1:15]

# Percentage of no zero values in the tapered matrix
#matrix2$nozero

################################################################
###
### Example 4. Tapered Covariance matrix associated to
### a space-time double exponential correlation model
###
###############################################################

#param <- list(scale_s=2,scale_t=1,sill=1,mean=0)
#matrix4 <- Covmatrix(x, y, times, corrmodel="exp_exp", param=param, maxdist=0.3,
#                     maxtime=2,taper="Wendland2_Wendland2",type="Tapering")

# Tapered space time covariance matrix
#as.matrix(matrix4$covmatrix)[1:10,1:10]

# Percentage of no zero values in the tapered matrix
#matrix4$nozero

[Package CompRandFld version 1.0.3-6 Index]