Description Usage Arguments Details Value Author(s) See Also Examples
Uses the generalised additive model gam to non-linearly and non-parametrically regress set of variables X on a set of variables S and returns residuals of X.
1 | regrXonS(X, S)
|
X |
numeric matrix, set of variables to be regressed. Each column represents separate variable |
S |
numeric matrix, set of variables we will regress on. Each column represents separate variable |
If the number of variables in S is <= 5 we use frml.full.smooth as formula for gam to regress X on S, otherwise we use frml.additive.smooth.
regrXonS() returns the residuals of X regressed on S.
Petras Verbyla (petras.verbyla@mrc-bsu.cam.ac.uk)
kernelCItest
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(10)
library(energy)
z <- 10*runif(300)
w <- 10*runif(300)
x <- sin(z) + runif(300)
y <- cos(z) + runif(300)
data <- cbind(x,y,z,w)
hsic.gamma(x,y)
hsic.perm(x,y)
dcov.test(x,y)
resid <- regrXonS(cbind(x,y),cbind(z,w))
hsic.gamma(resid[,1],resid[,2])
hsic.perm(resid[,1],resid[,2])
dcov.test(resid[,1],resid[,2])
|
HSIC test of independence
data: Gamma approximation
HSIC = 0.0037736, p-value = 0.0001712
sample estimates:
HSIC
0.003773572
HSIC test of independence
data: Permutation approximation
HSIC = 0.0037736, p-value = 0.0198
sample estimates:
HSIC
0.003773572
Specify the number of replicates R (R > 0) to perform the test of
independence
data: index 1, replicates 0
nV^2 = 1.7572, p-value = NA
sample estimates:
dCov
0.07653368
HSIC test of independence
data: Gamma approximation
HSIC = 2.8165e-05, p-value = 0.5805
sample estimates:
HSIC
2.816463e-05
HSIC test of independence
data: Permutation approximation
HSIC = 2.8165e-05, p-value = 0.5941
sample estimates:
HSIC
2.816463e-05
Specify the number of replicates R (R > 0) to perform the test of
independence
data: index 1, replicates 0
nV^2 = 0.078235, p-value = NA
sample estimates:
dCov
0.01614876
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.