Path.Resample: Residual bootsrrap the Leave-One-Covariate-Out regularization...

Description Usage Arguments Value Examples

View source: R/ResampleTS.R

Description

This function performs residual bootsrrap the Leave-One-Covariate-Out regularization path test staitsic and would return test p-value

Usage

1
2
3
Path.Resample(X, Y, which.covariate, betaNull, multiTest, B = 500,
  parallel = FALSE, exact = TRUE, beta.init = "adaptive",
  beta.true = beta, ...)

Arguments

X:

a n by p matrix, design matrix

Y:

a n by 1 matrx, response

which.covariate:

a vector or a list of vector, specify which covaritate β_j to perform our test

betaNull:

a vector or a list of vector, should be the same shape as which.covariate. Specify the Null hypothesis, H_0: β_j = betaNull vs H_1 \neq betaNull if using multiTest = FALSE, then will return

multiTest:

boolean, TRUE: test simultaneously, FALSE: test individually

B:

integer, number of bootstraps

parallel:

boolean, run the whole bootstrap process in parallell, useful if run in a multicore cpu, especially in cluster

exact:

boolean, using ExactPath.TS or AprroxPath.TS

beta.init:

str, c("adaptive", "de-sparse", "MC+", "SCAD", "Truth"). Under developing, please use "adaptive" and "Truth". Needed if perform high-dimensional regression, low-dimensional regression will use LSE.

beta.true:

true value of beta, if your beta.init = "Truth", need to specify this

...:

args wull be passed to ExactPath.TS or ApproxPath.Ts

Value

a list of p-value, TS, TS_null, rej or nor

Examples

1
2
3
4
5
6
7
8
9
X = matrix(rnorm(100*12), 100, 12)
beta = c(1,2, rep(0, 10))
Y = X %*% beta + rnorm(100)
# Test \eqn{H_0: \beta_1 = 1} and \eqn{H_0: \beta_1 = 2} individually 
Path.Resample(X, Y, which.covariate = c(1, 2), betaNull = c(1, 2), multiTest = FALSE, B = 100)
# Test \eqn{H_0: \beta_1 = 1, \beta_1 = 2} simultaneously
Path.Resample(X, Y, which.covariate = list(c(1, 2)), betaNull = list(c(1, 2)), multiTest = TRUE, B = 100)
# Test \eqn{H_0: \beta_1 = 1, \beta_2 = 2} simultaneously and test \eqn{H_0: \beta_1 = 0, \beta_2 = 0}
Path.Resample(X, Y, which.covariate = list(c(1, 2), c(1, 2)), betaNull = list(c(1, 2), c(0, 0)), multiTest = TRUE, B = 100)

statcao/LOCOpath documentation built on July 11, 2020, 6:44 p.m.