plot.coefficients {BoomSpikeSlab} | R Documentation |
Produces boxplots showing the marginal distribution of the coefficients.
PlotLmSpikeCoefficients( beta, burn = 0, inclusion.threshold = 0, scale.factors = NULL, number.of.variables = NULL, ...)
beta |
A matrix of model coefficients. Each row represents an MCMC draw. Each column represents a coefficient for a variable. |
burn |
The number of MCMC iterations in the ojbect to be discarded as burn-in. |
inclusion.threshold |
Only plot coefficients with posterior inclusion probabilities exceeding this value. |
scale.factors |
If non-null then a vector of scale factors with which to
scale the columns of beta. A |
number.of.variables |
If non- |
... |
Additional arguments to be passed to |
Returns the value from the final call to boxplot
.
Steven L. Scott
lm.spike
SpikeSlabPrior
summary.lm.spike
predict.lm.spike
simulate.lm.spike <- function(n = 100, p = 10, ngood = 3, niter=1000, sigma = 1){ x <- cbind(matrix(rnorm(n * (p-1)), nrow=n)) beta <- c(rnorm(ngood), rep(0, p - ngood)) y <- rnorm(n, beta[1] + x %*% beta[-1], sigma) draws <- lm.spike(y ~ x, niter=niter) return(invisible(draws)) } model <- simulate.lm.spike(n = 1000, p = 50, sigma = .3) plot(model, "coef", inclusion.threshold = .01)