Plots the posterior densities of the gamma parameters estimated by a birp object.
# S3 method for birp
plot(
x,
shadingIncrease = NA,
shadingDecrease = "#f2c7c7",
col = "black",
lwd = 1,
lty = 1:x$num_gamma,
xlim = NA,
ylim = NA,
add = FALSE,
xlab = expression(gamma),
ylab = "Posterior density",
legend = x$gamma_names,
lineAtZero = TRUE,
...
)No return value, called for side effects.
A birp object.
Character or color specification; Shading color for the range where the gamma parameter is greater than 0 (gamma > 0). If NA, shading is omitted. Default is NA.
Character or color specification; Shading color for the range where the gamma parameter is less than 0 (gamma < 0). If NA, shading is omitted. Default is "#f2c7c7".
Character vector or color values; Line color(s) for the density plots. If a single value is provided, it is recycled for all gamma parameters. Default is "black".
Numeric vector; Line width(s) for the density plots. If a single value is provided, it is recycled. Default is 1.
Numeric or character vector; Line type(s) for the density plots. If a single value is provided, it is recycled. Default is 1:x$num_gamma.
Numeric vector of length 2; Optional x-axis limits. If NA, limits are determined automatically from the density data. Default is NA.
Numeric vector of length 2; Optional y-axis limits. If NA, limits are determined automatically from the density data. Default is NA.
Logical; If TRUE, adds the densities to an existing plot. Otherwise, creates a new plot. Default is FALSE.
Character; Label for the x-axis. Default is expression(gamma).
Character; Label for the y-axis. Default is "Posterior density".
Character vector of legend labels, or NA to suppress the legend. Default is x$gamma_names.
Logical; If TRUE, adds a vertical line at x = 0 to indicate no effect. Default is TRUE.
Additional graphical parameters passed to lines (when plotting the densities) and plot (when creating a new plot).
birp
data <- simulate_birp()
est <- birp(data)
plot(est)
Run the code above in your browser using DataLab