MCMC-combos | R Documentation |
Combination plots
mcmc_combo(x, combo = c("dens", "trace"), ..., widths = NULL, gg_theme = NULL)
x |
An object containing MCMC draws:
|
combo |
A character vector with at least two elements. Each element of
|
... |
Arguments passed to the plotting functions named in |
widths |
A numeric vector the same length as |
gg_theme |
Unlike most of the other bayesplot functions,
|
A gtable object (the result of calling
gridExtra::arrangeGrob()
) with length(combo)
columns and
a row for each parameter.
Other MCMC:
MCMC-diagnostics
,
MCMC-distributions
,
MCMC-intervals
,
MCMC-nuts
,
MCMC-overview
,
MCMC-parcoord
,
MCMC-recover
,
MCMC-scatterplots
,
MCMC-traces
# some parameter draws to use for demonstration
x <- example_mcmc_draws()
dim(x)
dimnames(x)
mcmc_combo(x, pars = c("alpha", "sigma"))
mcmc_combo(x, pars = c("alpha", "sigma"), widths = c(1, 2))
# change second plot, show log(sigma) instead of sigma,
# and remove the legends
color_scheme_set("mix-blue-red")
mcmc_combo(
x,
combo = c("dens_overlay", "trace"),
pars = c("alpha", "sigma"),
transformations = list(sigma = "log"),
gg_theme = legend_none()
)
# same thing but this time also change the entire ggplot theme
mcmc_combo(
x,
combo = c("dens_overlay", "trace"),
pars = c("alpha", "sigma"),
transformations = list(sigma = "log"),
gg_theme = ggplot2::theme_gray() + legend_none()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.