Learn R Programming

EAlasso (version 0.1.0)

plot.MHLS: Plot Metropolis-Hastings sampler outputs

Description

Provides six plots for each covariate index; histogram, path plot and acf plot for beta and for its subgradient.

Usage

# S3 method for MHLS
plot(x, index = 1:ncol(x$beta), skipS = FALSE, ...)

Arguments

x

an object of class "MHLS", which is an output of MHLS.

index

an index of covariates to plot.

skipS

logical. If skipS = TRUE, plots beta only.

...

addtional arguments passed to or from other methods.

Details

plot.MHLS provides summary plots of beta and subgradient. The first column provides histogram of beta and subgradient, while the second and the third columns provide path and acf plots, respectively. If skipS = TRUE, this function provides summary plots for beta only.

Examples

Run this code
# NOT RUN {
#' 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
plot(MHLS(X = X, PE = rep(0, p), sig2 = 1, lbd = 1, group = 1:p,
     weights = weights, B0 = B0, S0 = S0, niter = 50, burnin = 0,
     type = "coeff"))
# }

Run the code above in your browser using DataLab