Learn R Programming

superdiag (version 2.0)

superdiagPlot: Summary Plots for mcmc Objects

Description

The superdiagPlot function takes mcmc or mcmc.list as input. It provides summary plots including trace plot(s) and density histogram(s) for each variable in the MCMC chain(s).

Usage

superdiagPlot(
  mcmcoutput,
  burnin,
  params,
  title,
  col,
  trace.options,
  density.options,
  title.options
)

# S3 method for mcmc superdiagPlot( mcmcoutput, burnin, params = "all", title, col = c("grey25", "grey75"), trace.options = list(trace.axis = TRUE, box = TRUE), density.options = list(), title.options = list() )

# S3 method for mcmc.list superdiagPlot( mcmcoutput, burnin, params = "all", title, col, trace.options = list(trace.axis = TRUE, box = TRUE), density.options = list(), title.options = list() )

Arguments

mcmcoutput

A mcmc or mcmc.list object.

burnin

The number of burn-in iterations. Defaults to half of the chain(s).

params

The parameters to be summarized. Defaults to all. Users can specify a subset of variables by name or index to reduce the size of plots.

title

A character vector specifies the title of the plot.

col

A vector or list specifies the color schemes of the plot. For mcmc object, the default is a two-color grey scheme; Users can specify any numbers of color no more than the number of variables. For mcmc.list object, it requires a list or vector with multiple colors to examine the mixing. The default is a list of two sets of colors.

trace.options

Additional options for trace plots. It can take arguments as in plot and lines functions.

density.options

Additional options for density histograms. It can take arguments as in hist (e.g breaks, freq, probability) and barplot functions.

title.options

Additional options for title. It can take arguments as in mtext function.

Value

A summary plot for each variable in the MCMC chain(s).

See Also

superdiag

Examples

Run this code
# NOT RUN {
data(tobit.list)
summary(tobit.list[1])

# FOR mcmc.list OBJECT
superdiagPlot(tobit.list, burnin=0)

# FOR mcmc OBJECT
superdiagPlot(tobit.list[[1]], burnin=0, col=c("grey25", "dodgerblue"),
  title = "Tobit Model (Chain 1)", title.options=list(cex=1.2))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab