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 |
st |
An |
gt |
A sequence of temporal kernel bandwidth |
gs |
A sequence of spatial kernel bandwidth |
Value
bandwidth |
A matrix containing all the bandwidths
( |
mspe |
The mean squared prediction errors for all the bandwidths provided by users. |
bandwidth.opt |
The bandwidths |
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)