Learn R Programming

BoomSpikeSlab (version 1.2.6)

plot.qreg.spike: Plot the results of a spike and slab regression.

Description

The default plot is a barplot of the marginal inclusion probabilities for each variable, as obtained by PlotMarginalInclusionProbabilities. Other interesting plots can be obtained by supplying a string as the second argument.

Usage

# S3 method for qreg.spike
plot(x,
     y = c("inclusion", "coefficients", "scaled.coefficients",
              "size", "help"),
     burn = SuggestBurnLogLikelihood(x$log.likelihood),
     ...)

Arguments

x

An object of class qreg.spike.

y

The type of plot desired.

burn

The number of MCMC iterations to discard as burn-in.

...

Additional arguments passed to the specific functions that do the plotting.

Author

Steven L. Scott

Details

The actual plotting will be handled by PlotMarginalInclusionProbabilities, PlotLmSpikeCoefficients, or PlotModelSize. See the appropriate function for more options.

See Also

PlotMarginalInclusionProbabilities PlotLmSpikeCoefficients PlotModelSize qreg.spike SpikeSlabPrior predict.qreg.spike

Examples

Run this code
  n <- 50
  x <- rnorm(n)
  y <- rnorm(n, 4 * x)
  model <- qreg.spike(y ~ x,
                      quantile = .8,
                      niter = 1000,
                      expected.model.size = 100)
  plot(model)
  plot(model, "coef")
  plot(model, "coefficients")
  plot(model, "scaled.coefficients")
  plot(model, "scal")
  plot(model, "size")
  plot(model, "help")

Run the code above in your browser using DataLab