Plots a 2D density contour for the joint posterior of two gamma parameters from a birp object.
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,
...
)No return value; called for side effects (plotting).
A birp object.
Integer; Index of the first gamma parameter to plot on the x-axis. Default is 1.
Integer; Index of the second gamma parameter to plot on the y-axis. Default is 2.
Character; Label for the x-axis. Default is dynamically set based on gamma1.
Character; Label for the y-axis. Default is dynamically set based on gamma2.
Numeric vector of length 2; Optional x-axis limits. Default is the range of gamma1 and gamma2 values.
Numeric vector of length 2; Optional y-axis limits. Default is the same as xlim.
Character or color specification; Color for contour lines. Default is "deeppink".
Character or NA; Color of the diagonal line (y=x). Use NA to omit. Default is "black".
Numeric; Line width of the diagonal line. Default is 1.
Numeric or character; Line type of the diagonal line. Default is 1 (solid).
Character or NA; Color of the zero reference lines (at x=0 and y=0). Use NA to omit. Default is "black".
Numeric; Line width of the zero reference lines. Default is 1.
Numeric or character; Line type of the zero reference lines. Default is 2 (dashed).
Logical; If TRUE, adds an annotation showing the posterior probability P(gamma1 < gamma2 | data) or P(gamma1 > gamma2 | data). Default is TRUE.
Logical; If TRUE, adds the contour plot to an existing plot. Default is FALSE.
Additional graphical parameters passed to contour.
birp
data <- simulate_birp(timesOfChange = 2)
est <- birp(data, timesOfChange = 2)
plot_epoch_pair(est)
Run the code above in your browser using DataLab