Draws a plot of the estimated marginal posterior density for a parameter and adds the mean and the credible interval at the desired level
multi_marginal_plot(
data,
position = 1:ncol(data),
level = 0.95,
grid_length = 1024,
x_scale = "calendar",
elapsed_origin_position = NULL,
title = "Characteristics of several dates",
subtitle = "Marginal densities",
caption = paste(level * 100, "% credible interval", sep = ""),
x_label = "Calendar year",
y_label = NULL,
density_fill = "gray30",
density_color = "black",
density_alpha = 1,
mean_color = "white",
mean_linetype = "dashed",
mean_size = 0.5,
ci_color = mean_color,
ci_linetype = "dotted",
ci_size = mean_size,
y_grid = TRUE,
x_min = NULL,
x_max = NULL,
height = 7,
width = 7,
units = "in",
file = NULL,
new_window = TRUE,
plot_result = TRUE,
fill_palette = NULL,
colors = NULL,
color_legend_name = "Legend"
)
Data frame containing the output of the MCMC algorithm.
Numeric vector containing the position of the column corresponding to the MCMC chains of interest, or a vector of column names.
Probability corresponding to the level of confidence.
Number of equally spaced points at which the
density is to be estimated (for density()
function).
One of "calendar" for calendar years, "BP" for years before present, or "elapsed" for time elapsed from a specified origin.
Position of the column to use as the origin for elapsed time calculations.
Title of the plot.
Subtitle of the plot.
Caption of the plot.
Label of the x-axis.
Label of the y-axis.
A color specification for the fill under the density line.
A color specification for the density line.
A number between 0 for transparent and 1 for opaque.
A color specification for the mean line.
A line type specification for the mean line.
A size specification for the mean line.
A color specification for the credible interval lines.
A line type specification for the credible interval lines.
A size specification of the credible interval lines.
Switch for horizontal grid lines.
Minimum x-axis value.
Maximum x-axis value.
Plot height in units
.
Plot width in units
.
String recognized by the ggsave()
function,
one of "in", "cm", "mm".
Name of the file that will be saved if specified,
default = NULL
.
Whether or not the plot is drawn within a new window.
If TRUE
, then draw a plot on the display,
else suppress drawing.
A vector of colors for qualitative data.
A vector of indices into palette keyed by position.
A label for the legend.
An archaeophases_plot
object with the data and metadata
needed to reproduce the plot.
The density is estimated using density()
function with
n = grid_length.
The input MCMC chains should either be in
calendar years or converted to calendar years using x_scale
vector or
elapsed_origin_position
.
# NOT RUN {
data(Events);
multi_marginal_plot(Events, position = c(2, 3, 4), level = 0.95)
# }
Run the code above in your browser using DataLab