Skip to contents

Extract the weighted adjacency matrix (posterior mean) from estimate, explore, ggm_compare_estimate, and ggm_compare_explore objects.

Usage

weighted_adj_mat(object, ...)

Arguments

object

A model estimated with BGGM. All classes are supported, assuming there is matrix to be extracted.

...

Currently ignored.

Value

The weighted adjacency matrix (partial correlation matrix with zeros).

Examples

# \donttest{
# note: iter = 250 for demonstrative purposes
Y <- bfi[,1:5]

# estimate
fit <- estimate(Y, iter = 250,
                progress = FALSE)

# select graph
E <- select(fit)

# extract weighted adj matrix
weighted_adj_mat(E)
#>        [,1]   [,2]   [,3]  [,4]  [,5]
#> [1,]  0.000 -0.241 -0.106 0.000 0.000
#> [2,] -0.241  0.000  0.286 0.164 0.157
#> [3,] -0.106  0.286  0.000 0.179 0.359
#> [4,]  0.000  0.164  0.179 0.000 0.121
#> [5,]  0.000  0.157  0.359 0.121 0.000

# }