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 y(t,s).

st

A three-column matrix specifying the spatial locations and times for all the spatio-temporal observations in y.

ht

A sequence of temporal kernel bandwidth ht provided by users; default is NULL, and mod_cv chooses its own sequence if ht=NULL.

hs

A sequence of temporal kernel bandwidth hs provided by users; default is NULL, and mod_cv chooses its own sequence if hs=NULL.

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:

K_{\epsilon}(x) = \frac{4}{4-3\epsilon-\epsilon^3} \left\{ \begin{array}{ll} \frac{3}{4}(1-x^2)\mbox{I}(|x|\leq 1), & \mbox{ if } |x| \geq \epsilon, \\ \frac{3(1-\epsilon^2)}{4\epsilon}|x|, & \mbox{ otherwise}. \end{array} \right.

The argument eps represents the parameter \epsilon in the above bimodal kernel, which controls the closeness of the bimodal kernel to the Epanechnikov kernel K_e(x)=0.75(1-x^2)\mbox{I}(|x|\leq 1). The smaller the value, the closer the two kernels.

Value

bandwidth

A matrix containing all the bandwidths (ht, hs) provided by users.

mcv

The modified cross-validation scores for all the bandwidths provided by users.

bandwidth.opt

The selected bandwidths (ht, hs) by the modified cross-validation.

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)

[Package SpTe2M version 1.0.3 Index]