Learn R Programming

birp (version 0.0.5)

plot_epoch_pair: Plot joint posterior of two gamma parameters

Description

Plots a 2D density contour for the joint posterior of two gamma parameters from a birp object.

Usage

plot_epoch_pair(
  x,
  gamma1 = 1,
  gamma2 = 2,
  xlab = .getLabelGamma.birp(x, gamma1),
  ylab = .getLabelGamma.birp(x, gamma2),
  xlim = range(x$trace_gamma[, c(gamma1, gamma2)]),
  ylim = xlim,
  col = "deeppink",
  diag.col = "black",
  diag.lwd = 1,
  diag.lty = 1,
  zero.col = "black",
  zero.lwd = 1,
  zero.lty = 2,
  print.p = TRUE,
  add = FALSE,
  ...
)

Value

No return value; called for side effects (plotting).

Arguments

x

A birp object.

gamma1

Integer; Index of the first gamma parameter to plot on the x-axis. Default is 1.

gamma2

Integer; Index of the second gamma parameter to plot on the y-axis. Default is 2.

xlab

Character; Label for the x-axis. Default is dynamically set based on gamma1.

ylab

Character; Label for the y-axis. Default is dynamically set based on gamma2.

xlim

Numeric vector of length 2; Optional x-axis limits. Default is the range of gamma1 and gamma2 values.

ylim

Numeric vector of length 2; Optional y-axis limits. Default is the same as xlim.

col

Character or color specification; Color for contour lines. Default is "deeppink".

diag.col

Character or NA; Color of the diagonal line (y=x). Use NA to omit. Default is "black".

diag.lwd

Numeric; Line width of the diagonal line. Default is 1.

diag.lty

Numeric or character; Line type of the diagonal line. Default is 1 (solid).

zero.col

Character or NA; Color of the zero reference lines (at x=0 and y=0). Use NA to omit. Default is "black".

zero.lwd

Numeric; Line width of the zero reference lines. Default is 1.

zero.lty

Numeric or character; Line type of the zero reference lines. Default is 2 (dashed).

print.p

Logical; If TRUE, adds an annotation showing the posterior probability P(gamma1 < gamma2 | data) or P(gamma1 > gamma2 | data). Default is TRUE.

add

Logical; If TRUE, adds the contour plot to an existing plot. Default is FALSE.

...

Additional graphical parameters passed to contour.

See Also

birp

Examples

Run this code
data <- simulate_birp(timesOfChange = 2)
est <- birp(data, timesOfChange = 2)
plot_epoch_pair(est)

Run the code above in your browser using DataLab