PBsampler {EAinference} | R Documentation |
Parametric bootstrap sampler for lasso, group lasso, scaled lasso or scaled group lasso estimator
Description
Draw gaussian bootstrap or wild multiplier bootstrap samples for lasso, group lasso, scaled lasso and scaled group lasso estimators along with their subgradients.
Usage
PBsampler(X, PE_1, sig2_1, lbd_1, PE_2, sig2_2, lbd_2, weights = rep(1,
max(group)), group = 1:ncol(X), niter = 2000, type, PEtype = "coeff",
Btype = "gaussian", Y = NULL, parallel = FALSE, ncores = 2L,
verbose = FALSE)
Arguments
X |
predictor matrix. |
PE_1 , sig2_1 , lbd_1 |
parameters of target distribution.
(point estimate of beta or |
PE_2 , sig2_2 , lbd_2 |
additional parameters of target distribution. This is required
only if mixture distribution is used. sig2_2 is only needed when |
weights |
weight vector with length equal to the number of groups. Default is
|
group |
|
niter |
integer. The number of iterations. Default is |
type |
type of penalty. Must be specified to be one of the following:
|
PEtype |
Type of |
Btype |
Type of bootstrap method. Users can choose either |
Y |
response vector. This is only required when |
parallel |
logical. If |
ncores |
integer. The number of cores to use for parallelization. |
verbose |
logical. This works only when
|
Details
This function provides bootstrap samples for lasso, group lasso,
scaled lasso or scaled group lasso estimator
and its subgradient.
The sampling distribution is characterized by (PE, sig2, lbd)
.
If Btype = "gaussian"
, error_new
is generated from N(0, sig2)
.
If Btype = "wild"
, we first generate error_new
from N(0, 1)
and multiply with the residuals.
Then, if PEtype = "coeff"
, y_new
is generated by X * PE + error_new
and if PEtype = "mu"
, y_new
is generated by PE + error_new
.
By providing (PE_2, sig2_2, lbd_2)
, this function simulates from a mixture distribution.
With 1/2 probability, samples will be drawn from the distribution with parameters
(PE_1, sig2_1, lbd_1) and with another 1/2 probability, they will be drawn from
the distribution with parameters (PE_2, sig2_2, lbd_2).
Four distinct penalties can be used; "lasso"
for lasso, "grlasso"
for group lasso,
"slasso"
for scaled lasso and "sgrlasso"
for scaled group lasso.
See Zhou(2014) and Zhou and Min(2017) for details.
Value
beta |
coefficient estimate. |
subgrad |
subgradient. |
hsigma |
standard deviation estimator, for type="slasso" or type="sgrlasso" only. |
X , PE , sig2 , weights , group , type , PEtype , Btype , Y , mixture |
model parameters. |
References
Zhou, Q. (2014), "Monte Carlo simulation for Lasso-type problems by estimator augmentation," Journal of the American Statistical Association, 109, 1495-1516.
Zhou, Q. and Min, S. (2017), "Estimator augmentation with applications in high-dimensional group inference," Electronic Journal of Statistics, 11(2), 3039-3080.
Examples
set.seed(1234)
n <- 10
p <- 30
Niter <- 10
Group <- rep(1:(p/10), each = 10)
Weights <- rep(1, p/10)
x <- matrix(rnorm(n*p), n)
#
# Using non-mixture distribution
#
PBsampler(X = x, PE_1 = rep(0, p), sig2_1 = 1, lbd_1 = .5,
weights = Weights, group = Group, type = "grlasso", niter = Niter, parallel = FALSE)
PBsampler(X = x, PE_1 = rep(0, p), sig2_1 = 1, lbd_1 = .5,
weights = Weights, group = Group, type = "grlasso", niter = Niter, parallel = TRUE)
#
# Using mixture distribution
#
PBsampler(X = x, PE_1 = rep(0, p), sig2_1 = 1, lbd_1 = .5,
PE_2 = rep(1, p), sig2_2 = 2, lbd_2 = .3, weights = Weights,
group = Group, type = "grlasso", niter = Niter, parallel = TRUE)