combinePlotsBSL {BSL} | R Documentation |
Plot the densities of multiple “bsl” class objects.
Description
The function combinePlotsBSL
can be used to plot multiple
BSL densities together, optionally with the true values for the parameters.
Usage
combinePlotsBSL(
objectList,
which = 1L,
thin = 1,
burnin = 0,
thetaTrue = NULL,
label = NULL,
legendPosition = c("auto", "right", "bottom")[1],
legendNcol = NULL,
col = NULL,
lty = NULL,
lwd = NULL,
cex.lab = 1,
cex.axis = 1,
cex.legend = 0.75,
top = "Approximate Marginal Posteriors",
options.color = list(),
options.linetype = list(),
options.size = list(),
options.theme = list()
)
Arguments
objectList |
A list of “bsl” class objects. |
which |
An integer argument indicating which plot function to be
used. The default, |
thin |
A numeric argument indicating the gap between samples to
be taken when thinning the MCMC draws. The default is |
burnin |
the number of MCMC burn-in steps to be taken. |
thetaTrue |
A set of true parameter values to be included on the plots
as a reference line. The default is |
label |
A string vector indicating the labels to be shown in
the plot legend. The default is |
legendPosition |
One of the three string arguments, “auto”, “right”
or “bottom”, indicating the legend position. The default is “auto”,
which automatically choose from “right” and “bottom”. Only used when
|
legendNcol |
An integer argument indicating the number of columns of
the legend. The default, |
col |
A vector argument containing the plotting color for
each density curve. Each element of the vector will be passed into
|
lty |
A vector argument containing the line type for each
density curve. Each element of the vector will be passed into |
lwd |
A vector argument containing the line width for each
density curve. Each element of the vector will be passed into |
cex.lab |
The magnification to be used for x and y labels
relative to the current setting of cex. To be passed into |
cex.axis |
The magnification to be used for axis annotation
relative to the current setting of cex. To be passed into |
cex.legend |
The magnification to be used for legend annotation
relative to the current setting of cex. Only used when |
top |
A string argument of the combined plot title. Only used
when |
options.color |
A list of additional arguments to pass into function
|
options.linetype |
A list of additional arguments to pass into function
|
options.size |
A list of additional arguments to pass into function
|
options.theme |
A list of additional arguments to pass into the
|
Value
No return value, called for the plots produced.
See Also
ma2
, cell
, mgnk
and
toad
for examples.
Examples
## Not run:
toy_sim <- function(n, theta) matrix(rnorm(2*n, theta), nrow = n)
toy_sum <- ma2_sum
model <- newModel(fnSimVec = toy_sim, fnSum = toy_sum, sumArgs = list(epsilon = 2), theta0 = 0)
result1 <- bsl(y = 1:2, n = 100, M = 5e3, model = model, covRandWalk = matrix(1),
method = "BSL", plotOnTheFly = TRUE)
result2 <- bsl(y = 1:2, n = 100, M = 5e3, model = model, covRandWalk = matrix(1),
method = "uBSL", plotOnTheFly = TRUE)
result3 <- bsl(y = 1:2, n = 100, M = 5e3, model = model, covRandWalk = matrix(1),
method = "semiBSL", plotOnTheFly = TRUE)
combinePlotsBSL(list(result1, result2, result3), label = c("BSL","uBSL","semiBSL"), thin = 20)
## End(Not run)