# Covmatrix: Spatio-temporal (tapered) Covariance Matrix In CompRandFld: Composite-Likelihood Based Analysis of Random Fields

## 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

 1 2 3 4 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.

• Purerly spatial correlation models:

1. cauchy

R(h) = (1+h^2)^(-β)

The parameter β is positive. It is a special case of the gencauchy model.

2. exponential

R(h) = exp(-h)

This model is a special case of the whittle and the stable model.

3. gauss

R(h)=exp(-h^2)

This model is a special case of the stable model.

4. gencauchy (generalised cauchy)

R(h) = ( 1+h^α )^{-\frac{β}{α}}

The parameter α is in (0,2], and β is positive.

5. spherical

R(h) = (1- 1.5 h+0.5 h^3) 1_{[0,1]}(h)

This isotropic covariance function is valid only for dimensions less than or equal to 3.

6. stable

R(h)=exp(-h ^α)

The parameter α is in (0,2].

7. wave

R(h)=sin(h)/h if h>0 and C(0)=1

This isotropic covariance function is valid only for dimensions less than or equal to 3.

8. matern

R(h) = 2^{1-ν} Γ(ν)^{-1} x^ν K_ν(h)

The parameter ν is positive.
This is the model of choice if the smoothness of a random field is to be parametrised: if ν > m then the graph is m times differentiable.

• Spatio-temporal correlation models:

• Non-separable models:

1. gneiting (non-separabel space time model)

R(h, u) = \frac{e^{ \frac{-h^ν} { (1+u^λ)^{0.5 γ ν }}}} {1+u^λ}

The parameters ν and λ take values in [0,2]; the parameter γ take values in [0,1]. For γ=0 it is a separable model.

2. gneiting_GC (non-separabel space time model with great circle distances)

R(h, u) = \frac{ e^{ \frac{-u^λ }{1+h^ν)^{0.5 γ λ}} }} { 1+h^ν}

3. iacocesare (non-separabel space time model)

R(h, u) = (1+h^ν+u^λ)^{-δ}

The parameters ν and λ take values in [1,2]; the parameters δ must be greater than or equal to half the space-time dimension.

4. porcu (non-separabel space time model)

R(h, u) = (0.5 (1+h^ν)^γ +0.5 (1+u^λ)^γ)^{-γ^{-1}}

The parameters ν and λ take values in [0,2]; the paramete γ take values in [0,1]. The limit of the correlation model as γ tends to zero leads to a separable model.

5. porcu2 (non-separabel space time model)

R(h, u) =\frac{ e^{ -h^ν ( 1+u^λ)^{0.5 γ ν}}} { (1+u^λ)^{1.5}}

The parameters ν and λ take values in [0,2]; the parameter γ take values in [0,1]. For γ=0 it is a separable model.

• Separable models.

Space-time separable correlation models are easly obtained as the product of a spatial and a temporal correlation model, that is

R(h,u)=R(h) R(u)

Several combinations are possible:

1. exp_exp: spatial exponential model and temporal exponential model

2. exp_cauchy: spatial exponential model and temporal cauchy model

3. matern_cauchy: spatial matern model and temporal cauchy model

4. stable_stable: spatial stabel model and temporal stable model

Note that some models are nested. (The exp_exp with the stable_stable for instance.)

• Spatial taper function models.

For spatial covariance tapering the tapered correlation functions are:

1. Wendland1

R(h) = (1-h)^2 (1+0.5 h) 1_{[0,1]}(h)

2. Wendland2

R(h) = (1-h)^4 (1+4 h) 1_{[0,1]}(h)

3. Wendland3

R(h) = (1-h)^6 (1+6 h + 35 h^2 /3) 1_{[0,1]}(h)

• Spatio-tempora tapered correlation models.

For space-time covariance tapering likelihood the taper functions are obtained as the product of a spatial and a temporal taper (Separable taper). Several combinations are possible:

• Wendlandi_Wendlandj: spatial Wendlandi taper and temporal Wendlandj taper with i,j=1,2,3.

• Space-time non separable adaptive-taper with dynamically space-time compact support is:

• qt_time and qt_space. In The case of qt_time the space-time quasi taper is:

T(h,u) = (arg)^{-6} (1+7 x) (1-x)^7 1_{[0,\frac{maxtime}{arg}]}(u)

arg=(1+\frac{h}{maxdist} )^β, x=u \frac{ arg}{maxtime}

where 0<=β<=1 is a fixed parameter of separability (tapsep), maxtime  the fixed temporal compact support and maxdist the fixed spatial scale parameter. The adaptive-taper qt_space is the same taper but changing the time with the space.

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:

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

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.

## 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

Kri, RFsim, FitComposite

## Examples

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 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 

### Example output

Loading required package: dotCall64
Spam version 2.1-1 (2017-07-02) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

backsolve, forwardsolve

[1] 500 500
[1] 1500 1500


CompRandFld documentation built on Jan. 10, 2020, 9:08 a.m.