Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cov.st

Calculates spatio-temporal covariance


Description

Calculates spatial covariance matrix of the observed responses, and possibly, the responses to be predicted. If pcoords is not provided, then only V, the covariance matrix of the observed responses will be returned. If pcoords is provided, then Vp and Vop (the covariance matrix for predicted responses and between observed and predicted responses, respectively) will also be returned.

Usage

cov.st(coords, time, sp.type = "exponential", 
	    sp.par = stop("specify sp.par argument"),
 	    error.var = 0, smoothness = 0.5, finescale.var = 0, 
	    t.type = "ar1", t.par = .5, 
	    pcoords = NULL, ptime = NULL, 
	    D = NULL, Dp = NULL, Dop = NULL, 
	    T = NULL, Tp = NULL, Top = NULL)

Arguments

coords

A numeric matrix of size n \times d containing the observed data locations.

time

A numeric matrix of size n \times 1 containing the times at which the data was observed.

sp.type

A character vector specifying the spatial covariance type. Valid types are currently exponential, gaussian, matern, and spherical.

sp.par

A vector of length 2 specifying the scale and dependence of the covariance function. The first element refers to the variance of the hidden process (sometimes this is called the partial sill) while the second elements determines the strength of dependence between locations.

error.var

A non-negative number indicating the variance of the error term.

smoothness

A positive number indicating the variance of the error term.

finescale.var

A non-negative positive number indicating the finescale variability. The is also called the microscale variance

t.type

A character vector indicating the temporal dependance structure. Currently, only "ar1" is implemented.

t.par

A numeric vector of length 1 indicating the strength of temporal dependence.

pcoords

A numeric matrix of size np \times d containing the locations of the responses to be predicted

ptime

A numeric matrix of size np \times 1 containing the times at which the responses are to be predicted.

D

The Euclidean distance matrix for the coords matrix. Must be of size n \times n.

Dp

The Eucliean distance matrix for the pcoords matrix. Must be of size np \times np.

Dop

The Eucliean intersite distance matrix between the locations in coords and the locations in pcoords. Must be of size n \times np.

T

The Euclidean distance matrix for the time matrix. Must be of size n \times n.

Tp

The Eucliean distance matrix for the ptime matrix. Must be of size np \times np.

Top

The Eucliean intertime distance matrix between the times in time and ptime. Must be of size n \times np.

Details

At this point, this function only implements a separable spatio-temporal covariance funcation. If h is the distance between two sites, and t is the temporal lag between the times when the associated responses were observed, then the covariance function C(h,t) = Cs(h) \times Ct(t) where Cs is a spatial covariance function corresponding to the exponential, matern, gaussian, or spherical and Ct is the temporal covariance function corresponding to an ar1 process with Ct(t) = φ ^ t.

The D, Dp, Dop, T, Tp, Top arguments are supplied to decrease the number of necessary computations needed when performing repetitive analysis or simulations. It is probably in the user's interest to not supply these arguments unless the duration of analysis is an important consideration. Note that these arguments override the information given in coords, pcoords, time, and prime, i.e., if dist1(coords) != D, then D is used in subsequent calculations, etc. This could create problems.

Value

Returns a list with the following elements:

V

The covariance matrix for the observed responses.

Vp

The covariance matrix for the predicted responses. Only returned if pcoords is supplied.

Vp

The covariance matrix between the observed responses and the predicted responses. Only returned if pcoords is supplied. Will be of size n \times np

Author(s)

Joshua French

See Also

simple.cov.sp

Examples

coords <- matrix(rnorm(30), ncol = 3)
	pcoords <- matrix(rnorm(90), ncol = 3)
	time <- 1:10
	ptime <- 1:30
	cov.st(coords = coords, time = time, sp.type = "exponential", 
	    sp.par = c(2, 1), error.var = 1, t.type = "ar1", t.par = .5, 
	    pcoords = pcoords, ptime = ptime)

SpatialTools

Tools for Spatial Data Analysis

v1.0.4
GPL (>= 2)
Authors
Joshua French <joshua.french@ucdenver.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.