Title: | Simultaneous Inference for Linear Models |
---|---|
Description: | Simultaneous inference procedures for high-dimensional linear models as described by Zhang, X., and Cheng, G. (2017) <doi:10.1080/01621459.2016.1166114>. |
Authors: | Xianyang Zhang, Guang Cheng, Jincheng Bai |
Maintainer: | Xianyang Zhang <[email protected]> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2024-11-19 06:11:20 UTC |
Source: | https://github.com/cran/SILM |
This function implements the method for constructing simultaneous confidence interval in Zhang and Cheng (2017).
Sim.CI(X, Y, set, M = 500, alpha = 0.95)
Sim.CI(X, Y, set, M = 500, alpha = 0.95)
X |
n times p design matrix. |
Y |
Response variable. |
set |
The set of variables of interest. |
M |
The number of bootstrap replications (default 500). |
alpha |
The nominal level alpha (default 0.95). |
The de-biased Lasso estimator, the confidence bands (lower bound and upper bound) delivered by the non-studentized and the studentized statistics.
Zhang, X., and Cheng, G. (2017) Simultaneous Inference for High-dimensional Linear Models, Journal of the American Statistical Association, 112, 757-768.
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 3 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,0,2) Y <- X%*%beta+rt(n,4)/sqrt(2) Sim.CI(X, Y, set)
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 3 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,0,2) Y <- X%*%beta+rt(n,4)/sqrt(2) Sim.CI(X, Y, set)
This function implements the support recovery procedure in Zhang and Cheng (2017).
SR(X, Y)
SR(X, Y)
X |
n times p design matrix. |
Y |
Response variable. |
The sets of active variables selected by the support recovery procedure and the scaled Lasso.
Zhang, X., and Cheng, G. (2017) Simultaneous Inference for High-dimensional Linear Models, Journal of the American Statistical Association, 112, 757-768.
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 7 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,1,2) Y <- X%*%beta+rt(n,4)/sqrt(2) SR(X, Y)
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 7 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,1,2) Y <- X%*%beta+rt(n,4)/sqrt(2) SR(X, Y)
This function implements the method for testing sparse signals in Zhang and Cheng (2017).
ST(X.f, Y.f, sub.size, test.set, M = 500, alpha = 0.05)
ST(X.f, Y.f, sub.size, test.set, M = 500, alpha = 0.05)
X.f |
n times p design matrix. |
Y.f |
Response variable. |
sub.size |
The sub-sample size used for screening. |
test.set |
The set of variables of interest. |
M |
The number of bootstrap replications (default 500). |
alpha |
The nominal level alpha (default 0.05). |
Values of the non-studentized and studentized statistics, and whether the tests get rejected at the level alpha.
Zhang, X., and Cheng, G. (2017) Simultaneous Inference for High-dimensional Linear Models, Journal of the American Statistical Association, 112, 757-768.
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 3 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,0,2) Y <- X%*%beta+rt(n,4)/sqrt(2) test.set <- (s0+1):p sub.size <- n*0.3 ST(X, Y, sub.size, test.set) test.set <- s0:p ST(X, Y, sub.size, test.set)
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 3 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,0,2) Y <- X%*%beta+rt(n,4)/sqrt(2) test.set <- (s0+1):p sub.size <- n*0.3 ST(X, Y, sub.size, test.set) test.set <- s0:p ST(X, Y, sub.size, test.set)
This function implements the stepdown method in Zhang and Cheng (2017).
Step(X, Y, M = 500, alpha = 0.05)
Step(X, Y, M = 500, alpha = 0.05)
X |
n times p design matrix. |
Y |
Response variable. |
M |
The number of bootstrap replications (default 500). |
alpha |
The nominal level alpha (default 0.05). |
A vector indicating which hypotheses are being rejected.
Zhang, X., and Cheng, G. (2017) Simultaneous Inference for High-dimensional Linear Models, Journal of the American Statistical Association, 112, 757-768.
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 3 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,1,2) Y <- X%*%beta+rt(n,4)/sqrt(2) Step(X, Y, M=500, alpha=0.05)
## The function is intended for large n and p. ## Use small p here for illustration purpose only. n <- 100 p <- 10 s0 <- 3 set <- 1:s0 Sigma <- matrix(NA, p, p) for (i in 1:p) Sigma[i,] <- 0.9^(abs(i-(1:p))) X <- matrix(rnorm(n*p), n, p) X <- t(t(chol(Sigma))%*%t(X)) beta <- rep(0,p) beta[1:s0] <- runif(s0,1,2) Y <- X%*%beta+rt(n,4)/sqrt(2) Step(X, Y, M=500, alpha=0.05)