plotcor_jags: Plot a correlation matrix from a JAGS object

View source: R/diagnostic_plots.R

plotcor_jagsR Documentation

Plot a correlation matrix from a JAGS object

Description

Plots a correlation matrix of all MCMC samples from an object returned by 'jagsUI', or an optional subset of parameter nodes. Correlation is plotted as shades of red (positive) or blue (negative).

In the case of vectors or arrays of nodes for each parameter name, a single axis tick will be used for all nodes with a single name. This has the effect of giving greater visual weight to single parameters, and reducing plot clutter.

Values of correlation are overlayed for all parameters with few nodes, with character size scaled according to the absolute correlation.

Usage

plotcor_jags(
  x,
  p = NULL,
  exact = FALSE,
  mincor = 0,
  maxn = 4,
  maxcex = 1,
  legend = TRUE,
  ...
)

Arguments

x

Output object returned from jagsUI, or a data.frame with MCMC output

p

Optional string to begin posterior names. If NULL is used, all parameters will be used

exact

Whether name must be an exact match (TRUE) or with initial sub-string matching only supplied characters (FALSE). Defaults to FALSE.

mincor

Minimum (absolute) correlation to use for text labels. Defaults to 0 (all will be plotted)

maxn

Maximum number of nodes per parameter name for text labels, to prevent plot clutter. Defaults to 4.

maxcex

Maximum character expansion factor for text labels. Defaults to 1.

legend

Whether to produce a plot legend. Defaults to TRUE.

...

Optional plotting arguments

Value

NULL

Author(s)

Matt Tyers

See Also

cor_jags

Examples

plotcor_jags(asdf_jags_out, maxcex=0.7)

plotcor_jags(SS_out, p=c("trend","rate","sig"))

jagshelper documentation built on Oct. 22, 2024, 1:06 a.m.