View source: R/plot_diagnostics.R
| plot_pairs | R Documentation |
Creates a pairs plot showing bivariate relationships between parameters. Divergent transitions (if present) are highlighted to help identify problematic posterior regions.
plot_pairs(
fit,
pars = NULL,
highlight_divergent = TRUE,
n_pars = 5,
alpha = 0.3
)
fit |
A |
pars |
Character vector of parameter names. If NULL, selects main variance parameters. |
highlight_divergent |
Logical; highlight divergent transitions in red (default: TRUE). |
n_pars |
Maximum number of parameters (default: 5). |
alpha |
Point transparency (default: 0.3). |
Pairs plots help identify:
Strong correlations between parameters (potential non-identifiability)
Multimodality
Regions where divergences cluster (indicating problematic geometry)
A ggplot object (if ggplot2/GGally available) or base R plot.
plot_divergences(), diagnostics()
set.seed(123)
df <- data.frame(x = rnorm(60))
df$y <- rpois(60, exp(0.5 + 0.3 * df$x))
fit <- tulpa(y ~ x, data = df, family = "poisson", mode = "hmc",
control = list(n_iter = 500L, warmup = 250L, n_chains = 2L,
seed = 1L))
plot_pairs(fit)
plot_pairs(fit, n_pars = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.