hdVARtest {hdiVAR}R Documentation

statistical inference for transition matrix in high-dimensional vector autoregression with measurement error

Description

Conduct global and simultaneous testing on the transition matrix.

Usage

hdVARtest(
  Y,
  A_est,
  sig2_eta,
  sig2_epsilon,
  global_H0 = NULL,
  global_idx = NULL,
  simul_H0 = NULL,
  simul_idx = NULL,
  FDR_levels = 0.05,
  grid_num = 2000
)

Arguments

Y

observations of time series, a p by T matrix.

A_est

a p by p matrix of transition matrix A estimate.

sig2_eta

scalar; estimate of propagation error variance \sigma_\eta^2.

sig2_epsilon

scalar; estimate of measurement error variance \sigma_\epsilon^2.

global_H0

a p by p matrix of global null hypothesis for transition matrix A. If global_H0=NULL, global testing will not be conducted, and global_idx will not be used.

global_idx

a p by p boolean matrix. The TRUE/nonzero entry indicates the entry of interest in global hypothesis testing. If global_idx=NULL, all p*p entries are included in global testing.

simul_H0

a p by p matrix of simultaneous null hypothesis for transition matrix A. If simul_H0=NULL, simultaneous testing will not be conducted, and (simul_idx, FDR_levels, grid_num) will not be used.

simul_idx

a p by p boolean matrix. The TRUE/nonzero entry indicates the entry of interest in simultaneous hypothesis testing. If simul_idx=NULL, all p*p entries are included in simultaneous testing.

FDR_levels

a vector of FDR control levels

grid_num

scalar; the number of grids for cutoff search in FDR control.

Value

a list of testing results and gaussian test statistic matrices.

pvalue scalar; p-value of global testing. Exist if global_H0 is not NULL.
global_test_stat a p by p matrix of gaussian test statistic for global null hypothesis. Exist if global_H0 is not NULL.
simul_test_stat a p by p matrix of gaussian test statistic for simultaneous null hypothesis. Exist if simul_H0 is not NULL.
FDR_levels a vector of FDR control levels. The same as input argument FDR_levels.
crt a vector of critical values for rejecting entries in simultaneous hypothesis under corresponding FDR control levels.
selected a three-way tensor. The first two modes are p by p, and the third mode is for FDR control levels. Nonzero elements indicate rejected entries (the first two modes) in simultanous hypothesis at correspoding FDR control levels (the third mode). The entries outside of simul_idx is set at zero.

Author(s)

Xiang Lyu, Jian Kang, Lexin Li

Examples


p= 3; Ti=200  # dimension and time
A=diag(1,p) # transition matrix
sig_eta=sig_epsilon=0.2 # error std
Y=array(0,dim=c(p,Ti)) #observation t=1, ...., Ti
X=array(0,dim=c(p,Ti)) #latent t=1, ...., T
Ti_burnin=300 # time for burn-in to stationarity
for (t in 1:(Ti+Ti_burnin)) {
  if (t==1){
    x1=rnorm(p)
  } else if (t<=Ti_burnin) { # burn in
    x1=A%*%x1+rnorm(p,mean=0,sd=sig_eta)
  } else if (t==(Ti_burnin+1)){ # time series used for learning
    X[,t-Ti_burnin]=x1
    Y[,t-Ti_burnin]=X[,t-Ti_burnin]+rnorm(p,mean=0,sd=sig_epsilon)
  } else {
    X[,t- Ti_burnin]=A%*%X[,t-1- Ti_burnin]+rnorm(p,mean=0,sd=sig_eta)
    Y[,t- Ti_burnin]=X[,t- Ti_burnin]+rnorm(p,mean=0,sd=sig_epsilon)
  }
}

# null hypotheses are true
hdVARtest(Y,A,sig_eta^2,sig_epsilon^2,global_H0=A,global_idx=NULL,
         simul_H0=A,simul_idx=NULL,FDR_levels=c(0.05,0.1))


# null hypotheses are false
hdVARtest(Y,A,sig_eta^2,sig_epsilon^2,global_H0=matrix(0,p,p),global_idx=NULL,
          simul_H0=matrix(0,p,p),simul_idx=NULL,FDR_levels=c(0.05,0.1))


[Package hdiVAR version 1.0.2 Index]