Learn R Programming

jarbes (version 2.5.0)

plot.bcmixmeta: Generic plot function for bcmixmeta object.

Description

This function is built with `ggplot2`. Parameters such as `binwidth`, `adjust`, `density.color`, `density.lwd`, and `density.lty` correspond directly to arguments in the `ggplot2` geoms.

Usage

# S3 method for bcmixmeta
plot(
  x,
  plot.type = "predictive_with_bias",
  n.samples = NULL,
  x.lim = NULL,
  y.lim = NULL,
  x.lab = NULL,
  y.lab = "Posterior Predictive Distribution",
  title.plot = NULL,
  show.histogram = TRUE,
  show.rug = TRUE,
  show.legend = FALSE,
  binwidth = 0.08,
  adjust = 1,
  predictive.color = "blue",
  mu.color = "black",
  bias.color = "red",
  hist.color = "black",
  hist.fill = "grey95",
  rug.color = "green",
  rug.alpha = 1,
  density.alpha = 0.4,
  density.lwd = 1,
  density.lty = 1,
  ...
)

Arguments

x

The object generated by the bcmixmeta function (the BC-BNP model output).

plot.type

A character string specifying the type of plot: "predictive_with_bias" (default), "predictive", "mu_posterior", "tau_posterior".

n.samples

The number of posterior samples to plot. If NULL, all posterior samples are used.

x.lim

Numeric vector of length 2 specifying the x-axis limits.

y.lim

Numeric vector of length 2 specifying the y-axis limits.

x.lab

Text with the label of the x-axis.

y.lab

Text with the label of the y-axis.

title.plot

Text for setting a title in the plot.

show.histogram

A logical value indicating whether to show the histogram.

show.rug

A logical value indicating whether to show the rug plot.

show.legend

A logical value indicating whether to display the legend.

binwidth

A numeric value specifying the bin width for the histogram.

adjust

A numeric value to adjust the bandwidth of the density curves.

predictive.color

A character value specifying the color of the posterior predictive density curve.

mu.color

A character value specifying the color of the posterior mean density curve.

bias.color

A character value specifying the color of the bias-adjusted mean density curve.

hist.color

A character value for the histogram border color.

hist.fill

A character value for the histogram fill color.

rug.color

A character value for the rug plot color.

rug.alpha

A numeric value between 0 and 1 specifying the rug plot transparency.

density.alpha

A numeric value between 0 and 1 specifying density transparency.

density.lwd

A numeric value specifying density line width.

density.lty

A numeric value specifying density line type.

...

...