plotHPDregion2D: 2D highest posterior density region

View source: R/plot.r

plotHPDregion2DR Documentation

2D highest posterior density region

Description

Given a sample from a multivariate posterior distribution, plot the bivariate region of highest marginal posterior density (HPD) for two variables with defined levels.

Usage

plotHPDregion2D(
  trace,
  vars,
  prob = c(0.95, 0.75, 0.5, 0.25, 0.1),
  xlab = NULL,
  ylab = NULL,
  plot = TRUE
)

Arguments

trace

either a data.frame or mcmc object.

vars

which variables to plot: numeric or character vector

prob

probability level

xlab

x axis label

ylab

y axis label

plot

if TRUE the plot is displayed, and returned otherwise.

Note

HPD levels are computed using the function HPDregionplot from the package emdbook.


sbfnk/fitR documentation built on July 18, 2023, 3:28 p.m.