comp.resids: Wrapper function to computing residuals from a regression...

Description Usage Arguments Value References Examples

View source: R/gcm.R

Description

This function is used for the GCM test. Other methods can be added.

Usage

1
comp.resids(V, Z, regr.pars, regr.method)

Arguments

V

A (nxp)-dimensional matrix (or data frame) with n observations of p variables.

Z

A (nxp)-dimensional matrix (or data frame) with n observations of p variables.

regr.pars

Some regression methods require a list of additional options.

regr.method

A string indicating the regression method that is used. Currently implemented are "gam", "xgboost", "kernel.ridge", "nystrom". The regression is performed only if not both resid.XonZ and resid.YonZ are set to NULL.

Value

Vector of residuals.

References

Please cite the following paper. Rajen D. Shah, Jonas Peters: "The Hardness of Conditional Independence Testing and the Generalised Covariance Measure" https://arxiv.org/abs/1804.07203

Examples

1
2
3
4
5
set.seed(1)
n <- 250 
Z <- 4*rnorm(n) 
X <- 2*sin(Z) + rnorm(n)
res <- comp.resids(X, Z, regr.pars = list(), regr.method = "gam")

GeneralisedCovarianceMeasure documentation built on Aug. 2, 2019, 5:05 p.m.