Learn R Programming

generalCorr (version 1.2.6)

GcRsqYXc: Nonlinear Granger causality between two time series workhorse function.(local constant version)

Description

Function input is y=LHS=First time series and x=RHS=Second time series. Kernel regression np package options regtype="lc" for local constant, and bwmethod="cv.ls" for least squares-based bandwidth selection are fixed. Denote Rsq=Rsquare=R^2 in nonlinear kernel regression. GcRsqYXc(.) computes the following two R^2 values. out[1]=Rsqyyx = R^2 when we regress y on own lags of y and x. out[2]=Rsqyy = R^2 when we regress y on own lags of y alone.

Usage

GcRsqYXc(y, x, px = 4, py = 4, pwanted = 4, ctrl = 0)

Value

This function returns a set of 2 numbers measuring nonlinear Granger-causality for time series. out[1]=Rsqyyx, out[2]=Rsqyy.

Arguments

y

The data vector y for the Left side or dependent or first variable

x

The data vector x for the right side or explanatory or second variable

px

number of lags of x in the data

py

number of lags of y in the data. px=4 for quarterly data

pwanted

number of lags of both x and y wanted for Granger causal analysis

ctrl

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

Author

Prof. H. D. Vinod, Economics Dept., Fordham University, NY.

References

Vinod, H. D. `Generalized Correlation and Kernel Causality with Applications in Development Economics' in Communications in Statistics -Simulation and Computation, 2015, tools:::Rd_expr_doi("10.1080/03610918.2015.1122048")

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.

See Also

GcRsqX12c

kern_ctrl

Examples

Run this code


if (FALSE) {
library(Ecdat);options(np.messages=FALSE);attach(data.frame(MoneyUS))
GcRsqYXc(y,m) 
}



Run the code above in your browser using DataLab