Learn R Programming

generalCorr (version 1.2.0)

GcRsqX12: Granger nonlinear causality R^2 for x1=f(x1,x2), R^2 for flipped x1 and x2 and the difference between the two R^2 values

Description

Calls GcRsqYX for R square from kernel regression (local linear version) R^2[x1=f(x1,x2)] choosing GcRsqYX(y=x1, x=x2). It predicts x1 from both x1 and x2 using all information till time (t-1). It also calls GcRsqYX again after flipping x1 and x2. It returns RsqX1onX2, RsqX2onX1 and the difference dif=(RsqX1onX2-RsqX2onX1) If (dif>0) the regression x1=f(x1,x2) is better than the flipped version implying that x1 is more predictable or x2 Granger causes x1, x2 --> x1, rather than vice versa. The kernel regressions use regtype="ll" for local linear, bwmethod="cv.aic" for AIC-based bandwidth selection.

Usage

GcRsqX12(x1, x2, px1 = 4, px2 = 4, pwanted = 4, ctrl = 0)

Arguments

x1

The data vector x1

x2

The data vector x2

px1

number of lags of x1 in the data default px1=4

px2

number of lags of x2 in the data, default px2=4

pwanted

number of lags of both x2 and x1 wanted for Granger causal analysis, default =4

ctrl

data matrix for designated control variable(s) outside causal paths default=0 means no control variables are present

Value

This function returns 3 numbers: RsqX1onX2, RsqX2onX1 and dif

returns a list of 3 numbers. RsqX1onX2=(Rsquare of kernel regression of X1 on X1 and X2), RsqX2onX1= (Rsquare of kernel regression of x2 on X2 and X1), and the difference between the two Rquares (first minus second) called dif

References

Vinod, H. D. `Generalized Correlation and Kernel Causality with Applications in Development Economics' in Communications in Statistics -Simulation and Computation, 2015, https://doi.org/gffn86

Vinod, H. D. 'New exogeneity tests and causal paths,' Chapter 2 in 'Handbook of Statistics: Conceptual Econometrics Using R', Vol.32, co-editors: H. D. Vinod and C.R. Rao. New York: North Holland, Elsevier Science Publishers, 2019, pp. 33-64.

Vinod, H. D. Causal Paths and Exogeneity Tests in Generalcorr Package for Air Pollution and Monetary Policy (June 6, 2017). Available at SSRN: https://www.ssrn.com/abstract=2982128

Zheng, S., Shi, N.-Z., Zhang, Z., 2012. Generalized measures of correlation for asymmetry, nonlinearity, and beyond. Journal of the American Statistical Association 107, 1239-1252. -at-note internal routine

See Also

bootGcRsq, causeSummary, GcRsqYX.

Examples

Run this code
# NOT RUN {

# }
# NOT RUN {
library(Ecdat);options(np.messages=FALSE);attach(data.frame(MoneyUS))
GcRsqX12(y,m)   
# }
# NOT RUN {


# }

Run the code above in your browser using DataLab