superdiagPlot: Summary Plots for 'mcmc' Objects

Description Usage Arguments Value See Also Examples

View source: R/plot.R

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

 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
superdiagPlot(
  mcmcoutput,
  burnin,
  params,
  title,
  col,
  trace.options,
  density.options,
  title.options
)

## S3 method for class '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 class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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))

## End(Not run)

superdiag documentation built on Dec. 5, 2020, 5:07 p.m.