mod_cv {SpTe2M} | R Documentation |
Modifed cross-validation for bandwidth selection
Description
The spatio-temporal mean function can be estimated by the local linear kernel
smoothing procedure (cf., Yang and Qiu 2018). The function mod_cv
provides a reliable tool for selecting bandwidths (ht, hs)
used in
the local linear kernel smoothing procedure in cases when data are
spatio-temporally correlated.
Usage
mod_cv(y, st, ht = NULL, hs = NULL, eps = 0.1)
Arguments
y |
A vector of the spatio-temporal response |
st |
A three-column matrix specifying the spatial locations and times for all
the spatio-temporal observations in |
ht |
A sequence of temporal kernel bandwidth |
hs |
A sequence of temporal kernel bandwidth |
eps |
The value of this parametric is between 0 and 1. Default is 0.1. The following bimodal kernel function (cf., Yang and Qiu 2018) is used when calculting the modified cross-validation score:
The argument |
Value
bandwidth |
A matrix containing all the bandwidths ( |
mcv |
The modified cross-validation scores for all the bandwidths provided by users. |
bandwidth.opt |
The selected bandwidths |
mcv.opt |
The modified cross-validation score of the selected bandwidths. |
Author(s)
Kai Yang kayang@mcw.edu and Peihua Qiu
References
Yang, K. and Qiu, P. (2018). Spatio-Temporal Incidence Rate Data Analysis by Nonparametric Regression. Statistics in Medicine, 37, 2094-2107.
Examples
library(SpTe2M)
data(sim_dat)
y <- sim_dat$y; st <- sim_dat$st
ht <- seq(0.10,0.15,0.05); hs <- seq(0.20,0.30,0.10)
ids <- 1:500; y.sub <- y[ids]; st.sub <- st[ids,]
mcv <- mod_cv(y.sub,st.sub,ht,hs,eps=0.1)