sar.gc.bootstrap {qfa}R Documentation

Bootstrap Simulation of SAR Coefficients for Granger-Causality Analysis

Description

This function simulates bootstrap samples of selected spline autoregression (SAR) coefficients for Granger-causality analysis based on the SAR model of quantile series (QSER) under H0: (a) for multiple time series, the second series specified in index is not causal for the first series specified in index; (b) for single time series, the series is not causal at the lags specified in index.

Usage

sar.gc.bootstrap(
  y.qser,
  fit,
  index = c(1, 2),
  nsim = 1000,
  method = c("ar", "sar"),
  n.cores = 1,
  mthreads = FALSE,
  seed = 1234567
)

Arguments

y.qser

matrix or array of QSER from qser() or qspec.sar()$qser

fit

object of SAR model from qser2sar() or qspec.sar()$fit

index

a pair of component indices for multiple time series or a sequence of lags for single time series (default = c(1,2))

nsim

number of bootstrap samples (default = 1000)

method

method of residual calculation: "ar" (default) or "sar"

n.cores

number of cores for parallel computing (default = 1)

mthreads

if TRUE, multithread BLAS is enabled when available (default = FALSE, required for parallel computing)

seed

seed for random sampling (default = 1234567)

Value

array of simulated bootstrap samples of selected SAR coefficients

Examples

y1 <- stats::arima.sim(list(order=c(1,0,0), ar=0.5), n=64)
y2 <- stats::arima.sim(list(order=c(1,0,0), ar=-0.5), n=64)
tau <- seq(0.1,0.9,0.05)
y.sar <- qspec.sar(cbind(y1,y2),tau=tau,p=1)
A.sim <- sar.gc.bootstrap(y.sar$qser,y.sar$fit,index=c(1,2),nsim=5)

[Package qfa version 2.1 Index]