cv_mspe {SpTe2M}R Documentation

Cross-validation mean squared prediction error

Description

The spatio-temporal covariance function is estimated by the weighted moment estimation method in Yang and Qiu (2019). The function cv_mspe is developed to select the bandwidths (gt,gs) used in the estimation of the spatio-temporal covariance function.

Usage

cv_mspe(y, st, gt = NULL, gs = NULL)

Arguments

y

A vector of length N containing data of the observed response y(t,s), where N is the total number of observations over space and time.

st

An N\times 3 matrix specifying the spatial locations (i.e., (s_u,s_v)) and times (i.e., t) for all the observations in y. The three columns of st correspond to s_u, s_v and t, respectively.

gt

A sequence of temporal kernel bandwidth gt provided by users; default is NULL, and cv_mspe will choose its own sequence if gt=NULL.

gs

A sequence of spatial kernel bandwidth gs provided by users; default is NULL, and cv_mspe will choose its own sequence if gs=NULL.

Value

bandwidth

A matrix containing all the bandwidths (gt, gs) provided by users.

mspe

The mean squared prediction errors for all the bandwidths provided by users.

bandwidth.opt

The bandwidths (gt, gs) that minimizes the mean squared prediction error.

mspe.opt

The minimal mean squared prediction error.

Author(s)

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

library(SpTe2M)
data(sim_dat)
y <- sim_dat$y; st <- sim_dat$st
gt <- seq(0.3,0.4,0.1); gs <- seq(0.3,0.4,0.1)
ids <- 1:500; y.sub <- y[ids]; st.sub <- st[ids,]
mspe <- cv_mspe(y.sub,st.sub,gt,gs)

[Package SpTe2M version 1.0.3 Index]