A pair plot built on GGally::ggpairs(): 1-D marginal densities on the
diagonal and 2-D highest-density regions (via ggdensity::geom_hdr()) in
the lower triangle, with optional markers for a reference (e.g. true)
parameter value. Analogous to Python sbi's pairplot.
Usage
pairplot(
samples,
truth = NULL,
labels = NULL,
limits = NULL,
col = "steelblue",
alpha = 0.4,
...
)Arguments
- samples
A matrix of posterior draws (rows = draws), or an
nsbi_samplesobject.- truth
Optional reference parameter vector to overlay.
- labels
Optional parameter labels. Defaults to
colnames(samples)(set automatically forsample()draws from a fit with named parameters – seeprior_uniform()/prior_normal()) ortheta[1],theta[2], .... Labels that parse as R syntax ("beta[1]","rho") render as their plotmath symbol.- limits
Optional list (one
c(lo, hi)per parameter, in column order) or matrix of per-parameter axis limits. Defaults to each parameter's own data range (padded 5%), applied consistently across every panel that plots it – without this, the lower-triangle and diagonal panels for the same parameter can each draw a different range, sinceggdensity::geom_hdr()andggplot2::geom_density()estimate their density grid independently per panel.- col
Density-region and marginal-density fill colour.
- alpha
Marginal-density fill transparency. The lower-triangle highest-density regions shade themselves by probability level (99/95/80/50%) instead, via
ggdensity's ownalphamapping.- ...
Passed to the lower-triangle
ggdensity::geom_hdr()layer.
