PBsampler: Parametric Bootstrap sampler for lasso, group lasso, scaled...

Description Usage Arguments Details Value References Examples

View source: R/PBsampler.R

Description

Draw guassian bootstrap or wild multiplier bootstrap samples to derive the lasso estimator along with its subgradient.

Usage

1
2
3
4
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 E(y) depends on PEtype, variance estimate of error and lambda).

PE_2, sig2_2, lbd_2

additional parameters of target distribution. This is required only if mixture distribution is used.

weights

weight vector with length equal to the number of groups. Default is rep(1, max(group)).

group

p x 1 vector of consecutive integers describing the group structure. The number of groups should be the same as max(group). Default is group = 1:p , where p is number of covariates. See examples for a guideline.

niter

integer. The number of iterations. Default is niter = 2000

type

type of penalty. Must be specified to be one of the following: "lasso", "grlasso", "slasso" or "sgrlasso".

PEtype

Type of PE which is needed to characterize the target distribution. Users can choose either "coeff" or "mu".

Btype

Type of bootstrap method. Users can choose either "gaussian" for guassian bootstrap or "wild" for wild multiplier bootstrap. Default is "gaussian".

Y

response vector. This is only required when Btype = "wild".

parallel

logical. If parallel = TRUE, uses parallelization. Default is parallel = FALSE.

ncores

integer. The number of cores to use for parallelization.

verbose

logical. This works only when parallel = FALSE.

Details

This function provides bootstrap samples for lasso, group lasso, scaled lasso or scaled group lasso estimator and its subgradient.
The sampling distribution is chracterized by (PE, sig2, lbd). If Btype = "gaussian", error_new is generated from N(0, sig2). If Btype = "wild", we further multiply error_new with the residuals. Then, if PEtype = "coeff", y_new is generated by X * PE + error_new and if PEtype = "mu", y_new is PE + error_new.

By providing (PE_2, sig2_2, lbd_2), users can use a mixture sampling distribution. In 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 distict 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(2016) 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)

EAlasso documentation built on Sept. 1, 2017, 9:03 a.m.