Posterior draws of the difference between two groups
diff_draws.RdFor each saved MCMC draw, computes the element-wise difference
\(D = X_k - X_m\) between groups k and m, where \(X\) is
either the partial correlation matrix or the precision matrix. Draws from
all chains of a multiggm_fit_list are pooled by default.
Arguments
- fit
A
multiggm_fitormultiggm_fit_listobject.- groups
Integer vector of length 2, the groups
c(k, m)to compare. Defaultc(1, 2).- scale
"pcor"(default) for partial correlations or"precision"for precision-matrix entries.- chain
NULL(default) pools all chains; an integer vector selects chains of amultiggm_fit_list.
Examples
sim <- simulate_multiggm(K = 2, p = 8, n = 80, seed = 1)
fit <- multiggm_mcmc(data_list = sim$data_list, burnin = 200, nsave = 100)
D <- diff_draws(fit)
dim(D)
#> [1] 8 8 100