Learn R Programming

SpTe2M (version 1.0.3)

spte_covest: Estimate the spatio-temporal covariance function

Description

The function spte_covest is developed to estimate the spatio-temporal covariance \(V(t,t';s,s')=\mbox{Cov}(y(t,s),y(t',s'))\) by the weighted moment estimation procedure (cf., Yang and Qiu 2019). It should be noted that the estimated covariance from spte_covest may not be positive semidefinite and thus it may not be a legitimate covariance function. In such cases, the projection-based modification needs to be used to make it positive semidefinite (cf., Yang and Qiu 2019).

Usage

spte_covest(y, st, gt = NULL, gs = NULL, stE1 = NULL, stE2 = NULL)

Value

stE1

Same as the one in the arguments.

stE2

Same as the one in the arguments.

bandwidth

The bandwidths (gt, gs) used in the weighted moment estimation procedure.

covhat

An \(N_1 \times N_2\) covariance matrix estimate.

Arguments

y

A vector of length \(N\) containing data of the observed response.

st

An \(N \times 3\) matrix specifying the spatial locations and times for all the spatio-temporal observations in y.

gt

The temporal kernel bandwidth gt; default is NULL, and it will be chosen by minimizing the mean squared prediction error via cv_mspe if gt=NULL.

gs

The spatial kernel bandwidth gs; default is NULL, and it will be chosen by the function cv_mspe if gs=NULL.

stE1

An \(N_1 \times 3\) matrix specifying the spatial locations \(s\) and times \(t\). Default value is NULL, and stE1=st if stE1=NULL.

stE2

An \(N_2 \times 3\) matrix specifying the spatial locations \(s'\) and times \(t'\). Default value is NULL, and stE2=st if stE2=NULL.

Author

Kai Yang kayang@mcw.edu and Peihua Qiu

References

Yang, K. and Qiu, P. (2019). Nonparametric Estimation of the Spatio-Temporal Covariance Structure. Statistics in Medicine, 38, 4555-4565.

Examples

Run this code
library(SpTe2M)
data(sim_dat)
y <- sim_dat$y; st <- sim_dat$st
ids <- 1:500; y.sub <- y[ids]; st.sub <- st[ids,]
cov.est <- spte_covest(y.sub,st.sub)

Run the code above in your browser using DataLab