sar.eq.test {qfa}R Documentation

Wald Test and Confidence Band for Equality of SAR-Based Granger-Causality in Two Samples

Description

This function computes Wald test and confidence band for equality of Granger-causality in two samples using bootstrap samples generated by sar.eq.bootstrap() based on the spline autoregression (SAR) models of quantile series (QSER).

Usage

sar.eq.test(A1, A1.sim, A2, A2.sim, sel.lag = NULL, sel.tau = NULL)

Arguments

A1

matrix of selected SAR coefficients for sample 1

A1.sim

simulated bootstrap samples from sar.eq.bootstrap() for sample 1

A2

matrix of selected SAR coefficients for sample 2

A2.sim

simulated bootstrap samples from sar.eq.bootstrap() for sample 2

sel.lag

indices of time lags for Wald test (default = NULL: all lags)

sel.tau

indices of quantile levels for Wald test (default = NULL: all quantiles)

Value

a list with the following elements:

test

list of Wald test result containing wald and p.value

D.u

matrix of upper limits of 95% confidence band for A1 - A2

D.l

matrix of lower limits of 95% confidence band for A1 - A2

Examples

y11 <- stats::arima.sim(list(order=c(1,0,0), ar=0.5), n=64)
y21 <- stats::arima.sim(list(order=c(1,0,0), ar=-0.5), n=64)
y12 <- stats::arima.sim(list(order=c(1,0,0), ar=0.5), n=64)
y22 <- stats::arima.sim(list(order=c(1,0,0), ar=-0.5), n=64)
tau <- seq(0.1,0.9,0.05)
y1.sar <- qspec.sar(cbind(y11,y21),tau=tau,p=1)
y2.sar <- qspec.sar(cbind(y12,y22),tau=tau,p=1)
A1.sim <- sar.eq.bootstrap(y1.sar$qser,y1.sar$fit,y2.sar$fit,index=c(1,2),nsim=5)
A2.sim <- sar.eq.bootstrap(y2.sar$qser,y2.sar$fit,y1.sar$fit,index=c(1,2),nsim=5)
A1 <- sar.gc.coef(y1.sar$fit,index=c(1,2))
A2 <- sar.gc.coef(y2.sar$fit,index=c(1,2))
test <- sar.eq.test(A1,A1.sim,A2,A2.sim,sel.lag=NULL,sel.tau=NULL)

[Package qfa version 2.1 Index]