Inference on the difference between unconditional and conditional Granger-causality spectrum is provided generating bootstrap time series by the stationary boostrap of Politis and Romano (1994). For computational details we refer to Ding et al. (2006) and Farne' and Montanari (2018).
Granger.inference.difference(x, y, z, ic.chosen = "SC",
max.lag = min(4, length(x) - 1), plot = F, type.chosen = "none",
p = 0, p1 = 0, p2 = 0, nboots = 1000, conf = 0.95,
bp_orig = NULL, ts_boot = 1)univariate time series.
univariate time series (of the same length of x).
univariate time series (of the same length of x).
estimation method parameter ic to be passed to function VAR of
package ''vars''. Defaults to ''SC'' (Schwarz criterion). Alternatives are c(''AIC'',''HQ'',''SC'',''FPE'').
maximum number of lags lag.max to be passed to function VAR.
Defaults to min(4, length(x) - 1).
logical; if TRUE, it returns the plot of the difference between the unconditional
Granger-causality spectrum from y to x and the conditional Granger-causality
spectrum from y to x on z with upper and lower computed thresholds.
Defaults to FALSE.
parameter type to be passed to function VAR.
Defaults to ''none''. Alternatives are c(''none'',''const'',''trend'').
parameter p to be passed to function VAR.
It corresponds to the number of delays for unconditional GC. Defaults to 0.
parameter p to be passed to function VAR.
It corresponds to the number of lags of the first VAR model. Defaults to 0.
parameter p to be passed to function VAR.
number of bootstrap series to be computed by function tsbootstrap
of package tseries. It defaults to 1000.
prescribed confidence level. It defaults to 0.95.
matrix containing previously simulated bootstrap series, having as rows
time points, as columns variables x and y (in this order). It defaults to NULL.
boolean equal to 1 if the stationary bootstrap of Politis and Romano (1994) is applied, 0 otherwise. It defaults to 1.
frequency: frequencies used by Fast Fourier Transform.
n: time series length.
nboots: number of bootstrap series used.
confidence_level: prescribed confidence level.
stat_yes: boolean equal to 0 if no stationary VAR
is estimated across bootstrap samples, 1 otherwise.
non_stationarity_rate: percentage of estimated non-stationary VAR models (at
least one root larger than one) on bootstrapped x and y.
non_stationarity_rate_1: percentage of estimated non-stationary VAR models (at
least one root larger than one) on bootstrapped x and z.
non_stationarity_rate_2: percentage of estimated non-stationary VAR models (at
least one root larger than one) on bootstrapped x, y and z.
quantile_difference_inf: lower computed quantile of the difference between the
Granger-causality unconditional spectrum from y to x and the Granger-causality
conditional spectrum from y to x on z.
quantile_difference_sup: upper computed quantile of the difference between the
Granger-causality unconditional spectrum from y to x and the Granger-causality
conditional spectrum from y to x on z.
freq_inf: frequencies at which the difference between the Granger-causality unconditional spectrum
from y to x and the Granger-causality conditional spectrum
from y to x on z exceeds the lower computed threshold.
freq_sup: frequencies at which the difference between the Granger-causality unconditional spectrum
from y to x and the Granger-causality conditional spectrum
from y to x on z exceeds the upper computed threshold.
quantile_difference_max_inf: lower computed quantile of the difference between the
Granger-causality unconditional spectrum from y to x and the Granger-causality
conditional spectrum from y to x on z under Bonferroni correction.
quantile_difference_max_sup: upper computed quantile of the difference between the
Granger-causality unconditional spectrum from y to x and the Granger-causality
conditional spectrum from y to x on z under Bonferroni correction.
freq_max_inf: frequencies at which the difference between the Granger-causality unconditional
spectrum from y to x and the Granger-causality conditional spectrum
from y to x on z exceeds the lower computed threshold under Bonferroni correction.
freq_max_sup: frequencies at which the difference between the Granger-causality unconditional
spectrum from y to x and the Granger-causality conditional spectrum
from y to x on z exceeds the upper computed threshold under Bonferroni correction.
The result is returned invisibly if plot is TRUE.
Granger.inference.difference provides bootstrap inference for the difference between
the Granger-causality unconditional spectrum of a time series x (effect variable)
respect to a time series y (cause variable) and the Granger-causality conditional
spectrum of a time series x (effect variable) on a time series z (conditioning variable)
respect to a time series y (cause variable). It requires packages vars and tseries.
Politis D. N. and Romano J. P., (1994). ''The Stationary Bootstrap''. Journal of the American Statistical Association, 89, 1303--1313.
Ding, M., Chen, Y., Bressler, S.L., 2006. Granger Causality: Basic Theory and Application to Neuroscience, Chap.17. Handbook of Time Series Analysis Recent Theoretical Developments and Applications.
Farne', M., Montanari, A., 2018. A bootstrap test to detect prominent Granger-causalities across frequencies. <arXiv:1803.00374>, Submitted.
VAR and tsbootstrap.
# NOT RUN {
RealGdp.rate.ts<-euro_area_indicators[,1]
m3.rate.ts<-euro_area_indicators[,2]
hicp.rate.ts<-euro_area_indicators[,4]
inf_diff_pre_hicp.to.gdp_0.95<-
Granger.inference.difference(RealGdp.rate.ts,m3.rate.ts,hicp.rate.ts,nboots=10)
# }
Run the code above in your browser using DataLab