Retrieves the posterior mean precision matrix from a model fitted with
bgm(). For GGM models this is the full precision matrix. For
mixed MRF models this is the precision matrix of the continuous
(Gaussian) block. OMRF models have no precision matrix and return NULL.
For mixed MRF models the precision matrix is reconstructed from the internal association-scale parameterization.
Arguments
- bgms_object
A fitted model object of class
bgms(frombgm()).
Value
A named numeric matrix containing the posterior mean precision
matrix, or NULL for OMRF models.
- GGM
A symmetric matrix with one row and column per variable.
- Mixed MRF
A symmetric matrix with one row and column per continuous variable.
- OMRF
NULL(invisibly).
See also
bgm(), coef.bgms(), extract_partial_correlations()
Other extractors:
extract_arguments(),
extract_category_thresholds(),
extract_ess(),
extract_group_params(),
extract_indicator_priors(),
extract_indicators(),
extract_log_odds(),
extract_main_effects(),
extract_pairwise_interactions(),
extract_partial_correlations(),
extract_posterior_inclusion_probabilities(),
extract_rhat(),
extract_sbm()
Examples
# \donttest{
fit = bgm(
x = Wenchuan[, 1:3],
variable_type = rep("continuous", 3)
)
#> 2 rows with missing values excluded (n = 360 remaining).
#> To impute missing values instead, use na_action = "impute".
#> Chain 1 (Sampling): ⦗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━⦘ 2000/2000 (100.0%)
#> Chain 2 (Sampling): ⦗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━⦘ 2000/2000 (100.0%)
#> Chain 3 (Sampling): ⦗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━⦘ 2000/2000 (100.0%)
#> Chain 4 (Sampling): ⦗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━⦘ 2000/2000 (100.0%)
#> Total (Sampling): ⦗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━⦘ 8000/8000 (100.0%)
#> Elapsed: 0s | ETA: 0s
extract_precision(fit)
#> intrusion dreams flash
#> intrusion 1.7365556 -0.8245852 -0.5123886
#> dreams -0.8245852 1.6340095 -0.6708828
#> flash -0.5123886 -0.6708828 1.5731360
# }