comparison.plot: Plot the results of compare.samplers

Description Usage Arguments Details Value Note References See Also

View source: R/comparison-plot.R


Generates a plot of representing results from compare.samplers.


comparison.plot(RS, xlab=NULL, ylab=NULL, base_size=10, ...)



A data frame in the form returned by compare.samplers and simulation.result.

xlab, ylab, ...

Options to be passed to ggplot2::qplot.


The text base size passed to ggplot2::theme_bw.


This function generates a grid of subplots, where each column of plots represents a sampler and each row represents a distribution. The horizontal axis in each subplot represents the tuning parameter passed as tuning to compare.samplers, and the vertical axis represents the product RS$evals * RS$act, the number of log density evaluations per independent sample required for that distribution when simulated by that sampler with that tuning parameter. 95% confidence intervals, covering the range [RS$evals * RS$act.025, RS$evals * RS$act.975], are represented by vertical bars. If RS$evals or RS$act is missing or infinite, a question mark is plotted instead of the default plot character.

comparison.plot returns a ggplot2 plot object. If it is called non-interactively, one must call print on the returned object for a plot to be displayed. To superimpose other figures of merit on the plot, one can add geom_* objects to the returned plot object before calling print.

For more discussion of this type of plot, see Thompson (2010).


A ggplot2 plot object.


This is the only function in SamplerCompare that uses the ggplot2 package, so it is loaded explicitly by comparison.plot instead of being listed as a package dependency. This way, compute servers calling compare.samplers do not need to have ggplot2 installed on them.


Thompson, M. B. (2010), Graphical comparison of MCMC performance, University of Toronto Dept. of Statistics technical report no. 1010.

Thompson, M. B. (2011), “Introduction to SamplerCompare,” Journal of Statistical Software 43(12):1-10, doi: 10.18637/jss.v043.i12.

See Also

compare.samplers, simulation.result, ggplot2::qplot, “Introduction to SamplerCompare” (vignette)

SamplerCompare documentation built on Oct. 22, 2021, 9:14 a.m.