Description Usage Arguments Details Value References Examples
Metropolis-Hastings sampler for lasso estimator under the fixed active set.
1 2 3 |
X |
predictor matrix. |
PE, sig2, lbd |
parameters of target distribution.
(point estimate of beta or |
weights |
weight vector with length |
B0 |
numeric vector with length |
S0 |
numeric vector with length |
A |
numeric vector. Active coefficient index.
Every active coefficient index in |
tau |
numeric vector with length |
niter |
integer. The number of iterations. Default is |
burnin |
integer. The length of burin-in periods. Default is |
PEtype |
Type of |
updateS.itv |
integer. Update subgradients every |
verbose |
logical. If true, print out the progress step. |
... |
complementary arguments.
|
Given appropriate initial value, provides Metropolis-Hastings samples under the fixed active set.
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. |
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.