Learn R Programming

BGGM (version 1.0.0)

plot.ggm_compare_ppc: Plot ggm_compare_ppc Objects

Description

Plot ggridges for the GGM comparison with posterior predictive KL-divergence. The plots contain the predictive distribution, assuming group equality, as well as the observed KL-divergence. Further, the predictive distributions are conveniently colored to infer whether the null of group equality should be rejected. This is accomplished by having the critical region, corresponding to a desired 'significance' level, shaded in red. Thus, if the observed value is in the red region, this suggests the null hypothesis of group equality should be rejected.

Usage

# S3 method for ggm_compare_ppc
plot(
  x,
  critical = 0.05,
  col_noncritical = "#84e184A0",
  col_critical = "red",
  point_size = 2,
  log = FALSE,
  ...
)

Arguments

x

object of class ggm_compare_ppc

critical

'significance' level

col_noncritical

fill color of the non critical region

col_critical

fill color of the critical region (e.g., critical = 0.05)

point_size

point size for the observed KL-divergence

log

log transformation. useful for small values and skewed predictive distributions

...

currently ignored

Value

one object of class ggplot when type = "global". One object for each pairwise contrast when type = "nodewise"

References

Williams, D. R., Rast, P., Pericchi, L. R., & Mulder, J. (2019). Comparing Gaussian Graphical Models with the Posterior Predictive Distribution and Bayesian Model Selection. pre print

Examples

Run this code
# NOT RUN {
# assume group equality
Y1 <- MASS::mvrnorm(500, rep(0, 16), Sigma = diag(16))
Y2 <- MASS::mvrnorm(500, rep(0, 16), Sigma = diag(16))
Y3 <- MASS::mvrnorm(500, rep(0, 16), Sigma = diag(16))

# global
ggm_ppc  <- ggm_compare_ppc(Y1, Y2, Y3, type = "global", iter = 50)

# plot
plot(ggm_ppc)

# }
# NOT RUN {
# nodewise
ggm_ppc  <- ggm_compare_ppc(Y1, Y2, Y3, type = "nodewise", iter = 50)

plot(ggm_ppc, log = TRUE)
# }

Run the code above in your browser using DataLab