comp.resids | R Documentation |

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

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

`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. |

Vector of residuals.

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

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")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.