sptemnt_ewmac {SpTe2M}R Documentation

Spatio-temporal process monitoring using covariate information

Description

The function sptemnt_ewmac is developed to solve the spatio-temporal process montoring problems in cases when the information in covariates needs to be used. Please refer to Qiu and Yang (2021) for more details of the method.

Usage

sptemnt_ewmac(
  y,
  x,
  st,
  type,
  ARL0 = 200,
  ARL0.z = 200,
  lambda = 0.1,
  B = 1000,
  bs = 5,
  T = 1,
  ht = NULL,
  hs = NULL,
  gt = NULL,
  gs = NULL
)

Arguments

y

A vector of N spatio-temporal observations.

x

An N\times p matrix containing the data of p covariates.

st

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

type

A vector of N characters specifying the types of the observations. Here, type could be IC1, IC2 or Mnt, where type='IC1' denotes the in-control (IC) observations used to perform the block bootstrap procedure to determine the control limit of the CUSUM chart, type='IC2' denotes the IC observations used to estimate the spatio-temporal mean and covariance functions by spte_meanest and spte_covest, and type='Mnt' denotes the observations used for online process monitoring (cf., Yang and Qiu 2021). If there are only data points with either type='IC1' or type='IC2', then these data points will be used to estimate the model and conduct the bootstrap procedure as well. This function will return an error if there are no observations with type='IC1' or type='IC2'.

ARL0

The pre-specified IC average run length. Default is 200.

ARL0.z

The pre-specified IC average run length for the covariate chart. Default is 200. Usually, set ARL0.z=ARL0.

lambda

The pre-specified weighting parameter in the EWMAC chart. Default is 0.1.

B

The bootstrap sizes used in the block bootstrap procedure for determining the control limit. Default value is 1,000.

bs

The block size of the block bootstrap procedure. Default value is 5.

T

The period of the spatio-temporal mean and covariance. Default value is 1.

ht

The temporal kernel bandwidth ht; default is NULL and it will be chosen by the modified cross-validation via mod_cv if ht=NULL.

hs

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

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.

Value

ARL0

Same as the one in the arguments.

lambda

Same as the one in the arguments.

cstat

The charting statistics which can be used to make a plot for the control chart.

cl

The control limit that is determined by the block bootstrap.

signal_time

The signal time (i.e., the first time point when the charting statistic cstat exceeds the control limit cl).

Author(s)

Kai Yang kayang@mcw.edu and Peihua Qiu

References

Qiu, P. and Yang, K. (2021). Effective Disease Surveillance by Using Covariate Information. Statistics in Medicine, 40, 5725-5745.

Examples

library(SpTe2M)
data(ili_dat)
n <- 365; m <- 67
y <- ili_dat$Rate; x <- as.matrix(ili_dat[,7:8]); st <- ili_dat[,3:5]
type <- rep(c('IC1','IC2','Mnt'),c(m*(n+1),(m*n),(m*n)))
ids <- c(1:(5*m),((n+1)*m+1):(m*(n+6)),((2*n+1)*m+1):(m*(2*n+6)))
y.sub <- y[ids]; x.sub <- x[ids,]; st.sub <- st[ids,]; type.sub <- type[ids]
ili.ewmac <- sptemnt_ewmac(y.sub,x.sub,st.sub,type.sub,ht=0.05,hs=6.5,gt=0.25,gs=1.5)

[Package SpTe2M version 1.0.3 Index]