boot_ncvreg | R Documentation |
Performs a hybrid bootstrapping approach to construct quantile based confidence intervals around the original lasso/MCP/SCAD estimator. Specifically, a traditional pairs bootstrap is performed with 1 adjustment: if the bootstrap sample for a given covariate is zero, a random sample from the full conditional posterior is used as the bootstrap sample instead. This avoids the creation of intervals with endpoints exactly equal to zero.
boot_ncvreg(
X,
y,
fit,
lambda,
sigma2,
cluster,
seed,
nboot = 1000,
penalty = "lasso",
level = 0.95,
gamma = switch(penalty, SCAD = 3.7, 3),
alpha = 1,
returnCV = FALSE,
return_boot = FALSE,
verbose = FALSE,
...
)
X |
The design matrix, without an intercept. |
y |
The response vector. |
fit |
(optional) An object of class |
lambda |
(optional) The value of lambda to provide interval estimates
for. If left missing will be selected using CV. If user wants
to set the lambda sequence used to select |
sigma2 |
(optional) The variance to use for the Hybrid sampling. If left missing will be set using the estimator suggested by Reid et. al. (2016) using CV. |
cluster |
Bootstrapping and |
seed |
You may set the seed of the random number generator in order
to obtain reproducible results. This is set for the overall
process. If the user wishes to set a seed specifically for
|
nboot |
The number of bootstrap replications to use. |
penalty |
The penalty to be applied to the model. Either "lasso" (the default), "MCP", or "SCAD". |
level |
The confidence level required. |
gamma |
The tuning parameter of the MCP/SCAD penalty
(see |
alpha |
Tuning parameter for the Elastc net estimator which controls
the relative contributions from the lasso/MCP/SCAD penalty and
the ridge, or L2 penalty. |
returnCV |
If |
return_boot |
If |
verbose |
If |
... |
named arguments to be passed to |
The resulting intervals WILL NOT have exact nominal coverage for all covariates. They are instead constructed in a way that overall coverage will be approximately equal to nominal so long as the true distribution of betas is Laplace and the covariates are independent. That said, in practice, average coverage is fairly robust to these assumptions.
Note: Draws from the full conditional posterior are approximations for
MCP/SCAD or when alpha
is not 1.
A list with:
A data.frame
with the original point estimates along with lower and upper bounds of Hybrid CIs.
The value of lambda
the confidence_intervals
were constructed at.
The value of sigma2
used for the Hybrid bootstrap sampling.
The penalty the intervals correspond to.
The tuning parameter for the Enet estimator used.
The confidence level the intervals correspond to.
If a penalty other than "lasso" is used,
The tuning parameter for MCP/SCAD penalty.
If returnCV
is TRUE
and a cv.ncvreg
object was fit or supplied
The cv.ncvreg
fit used to estimate lambda
and sigma2
(if applicable).
If return_boot
is TRUE
A data.frame
of the Hybrid bootstrap draws are returned.
data(Prostate)
X <- Prostate$X
y <- Prostate$y
boot_ncvreg(X, y, level = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.