MHLS: Metropolis-Hastings sampler for lasso estimator under the...

Description Usage Arguments Details Value References Examples

View source: R/MHLS.R

Description

Metropolis-Hastings sampler for lasso estimator under the fixed active set.

Usage

1
2
3
MHLS(X, PE, sig2, lbd, weights = rep(1, ncol(X)), B0, S0, A = which(B0 !=
  0), tau = rep(1, ncol(X)), niter = 2000, burnin = 0, PEtype = "coeff",
  updateS.itv = 1, verbose = FALSE, ...)

Arguments

X

predictor matrix.

PE, sig2, lbd

parameters of target distribution. (point estimate of beta or E(y) depends on PEtype, variance estimate of error and lambda).

weights

weight vector with length p(the number of covariates). Default is weights = rep(1, p).

B0

numeric vector with length p. Initial value of lasso estimator.

S0

numeric vector with length p. Initial value of subgradients. If not given, this will be generated in a default way.

A

numeric vector. Active coefficient index. Every active coefficient index in B0 must be included. Default is A = which(B0 != 0).

tau

numeric vector with length p. Standard deviaion of proposal distribution for each coefficient.

niter

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

burnin

integer. The length of burin-in periods. Default is burnin = 0

PEtype

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

updateS.itv

integer. Update subgradients every updateS.itv iterations. Set this value larger than niter if one wants to skip updating subgradients.

verbose

logical. If true, print out the progress step.

...

complementary arguments.

  • FlipSA : optional parameter. This has to be a subset of active set, A. If the index is not listed in FlipSA, the sign of coefficients which correspond to the listed index will remain fixed. The default is FlipSA=A

  • SFindex : optional parameter. subgradient index for the free coordinate.

  • randomSFindex : logical. If true, resample SFindex every updateSF.itv iterations.

  • updateSF.itv : integer. In every updateSF.itv iterations, randomize SFindex.

Details

Given appropriate initial value, provides Metropolis-Hastings samples under the fixed active set.

Value

MHLS returns an object of class "MHLS". The functions summary.MHLS and plot.MHLS provide a brief summary and generate plots.

beta

lasso samples.

subgrad

subgradient samples.

acceptHistory

numbers of acceptance and proposal.

niter, burnin, PE, type

same as function arguments.

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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#-------------------------
# Low dim
#-------------------------
set.seed(123)
n <- 10
p <- 5
X <- matrix(rnorm(n * p), n)
Y <- X %*% rep(1, p) + rnorm(n)
sigma2 <- 1
lbd <- .37
weights <- rep(1, p)
LassoResult <- Lasso.MHLS(X = X, Y = Y, lbd = lbd, type = "lasso", weights = weights)
B0 <- LassoResult$B0
S0 <- LassoResult$S0
MHLS(X = X, PE = rep(0, p), sig2 = 1, lbd = 1,
     weights = weights, B0 = B0, S0 = S0, niter = 50, burnin = 0,
     PEtype = "coeff")
MHLS(X = X, PE = rep(0, n), sig2 = 1, lbd = 1,
     weights = weights, B0 = B0, S0 = S0, niter = 50, burnin = 0,
     PEtype = "mu")

#-------------------------
# High dim
#-------------------------
set.seed(123)
n <- 5
p <- 10
X <- matrix(rnorm(n*p),n)
Y <- X %*% rep(1,p) + rnorm(n)
weights <- rep(1,p)
LassoResult <- Lasso.MHLS(X = X,Y = Y,lbd = lbd, type = "lasso", weights = weights)
B0 <- LassoResult$B0
S0 <- LassoResult$S0
MHLS(X = X, PE = rep(0, p), sig2 = 1, lbd = 1,
     weights = weights, B0 = B0, S0 = S0, niter = 50, burnin = 0,
     PEtype = "coeff")
MHLS(X = X, PE = rep(0, n), sig2 = 1, lbd = 1,
     weights = weights, B0 = B0, S0 = S0, niter = 50, burnin = 0,
     PEtype = "mu")

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