You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DESCRIPTION
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Authors@R: c(
16
16
comment = c(ORCID = "0000-0002-9838-7308"))
17
17
)
18
18
Maintainer: Maarten Marsman <m.marsman@uva.nl>
19
-
Description: Bayesian variable selection methods for analyzing the structure of a Markov Random Field model for a network of binary and/or ordinal variables. Details of the implemented methods can be found in: Marsman, van den Bergh, and Haslbeck (in press) <doi:10.31234/osf.io/ukwrf>.
19
+
Description: Bayesian variable selection methods for analyzing the structure of a Markov Random Field model for a network of binary and/or ordinal variables. Details of the implemented methods can be found in: Marsman, van den Bergh, and Haslbeck (2025) <doi:10.31234/osf.io/ukwrf>.
20
20
Copyright: Includes datasets 'ADHD' and 'Boredom', which are licensed under CC-BY 4. See individual data documentation for license and citation.
# bgms: Bayesian Analysis of Networks of Binary and/or Ordinal Variables
8
3
9
-
The R package <strong>bgms</strong> provides tools for Bayesian analysis of the ordinal Markov random field, a graphical model describing a network of binary and/or ordinal variables (Marsman, van den Bergh, & Haslbeck, in press). A pseudolikelihood is used to approximate the likelihood of the graphical model, and Markov chain Monte Carlo methods are used to simulate from the corresponding pseudoposterior distribution of the graphical model parameters.
10
-
11
-
The <strong>bgm</strong> function can be used for a one-sample design and the <strong>bgmCompare</strong> function can be used for an independent-sample design (see Marsman, Waldorp, Sekulovski, & Haslbeck, 2024). Both functions can model the selection of effects. In one-sample designs, the <strong>bgm</strong> function models the presence or absence of edges between pairs of variables in the network. The estimated posterior inclusion probability indicates how plausible it is that a network with an edge between the two corresponding variables produced the observed data, and can be converted into a Bayes factor test for conditional independence. The <strong>bgm</strong> function can also model the presence or absence of communities or clusters of variables in the network. The estimated posterior probability distribution of the number of clusters indicates how plausible it is that a network with the corresponding number of clusters produced the observed data, and can be converted into a Bayes factor test for clustering (see Sekulovski, Arena, Friel, & Marsman, 2025).
12
-
In an independent-sample design, the <strong>bgmCompare</strong> function models the selection of group differences in edge weights and possibly category thresholds. The estimated posterior inclusion probability indicates how plausible it is that graphical models with a difference in the corresponding edge weight or category threshold generated the data at hand, and can be converted to a Bayes factor test for parameter equivalence.
4
+
The `R` package <strong>bgms</strong> provides tools for Bayesian
5
+
analysis of the ordinal Markov random field, a graphical model
6
+
describing a network of binary and/or ordinal variables (Marsman, van
7
+
den Bergh, and Haslbeck 2025). A pseudolikelihood is used to approximate
8
+
the likelihood of the graphical model, and Markov chain Monte Carlo
9
+
methods are used to simulate from the corresponding pseudoposterior
10
+
distribution of the graphical model parameters.
11
+
12
+
The <strong>bgm</strong> function can be used for a one-sample design
13
+
and the <strong>bgmCompare</strong> function can be used for an
14
+
independent-sample design (see Marsman et al. 2024). Both functions can
15
+
model the selection of effects. In one-sample designs, the
16
+
<strong>bgm</strong> function models the presence or absence of edges
17
+
between pairs of variables in the network. The estimated posterior
18
+
inclusion probability indicates how plausible it is that a network with
19
+
an edge between the two corresponding variables produced the observed
20
+
data, and can be converted into a Bayes factor test for conditional
21
+
independence. The <strong>bgm</strong> function can also model the
22
+
presence or absence of communities or clusters of variables in the
23
+
network. The estimated posterior probability distribution of the number
24
+
of clusters indicates how plausible it is that a network with the
25
+
corresponding number of clusters produced the observed data, and can be
26
+
converted into a Bayes factor test for clustering (see Sekulovski et al.
27
+
2025).
28
+
29
+
In an independent-sample design, the <strong>bgmCompare</strong>
30
+
function models the selection of group differences in edge weights and
31
+
possibly category thresholds. The estimated posterior inclusion
32
+
probability indicates how plausible it is that graphical models with a
33
+
difference in the corresponding edge weight or category threshold
34
+
generated the data at hand, and can be converted to a Bayes factor test
35
+
for parameter equivalence.
13
36
14
37
## Why use Markov Random Fields?
15
38
16
-
Multivariate analysis using graphical models has received much attention in the recent psychological and psychometric literature (Robinaugh et al., 2020; Marsman, & Rhemtulla, 2022; Contreras et al., 2019). Most of these graphical models are Markov Random Field (MRF) models, whose graph structure reflects the partial associations between variables (Kindermann, & Snell, 1980). In these models, a missing edge between two variables in the network implies that these variables are independent, given the remaining variables (Lauritzen, 2004). In other words, the remaining variables of the network fully account for the potential association between the unconnected variables.
39
+
Multivariate analysis using graphical models has received much attention
40
+
in the recent psychological and psychometric literature (Robinaugh et
41
+
al. 2020; Marsman and Rhemtulla 2022; Contreras et al. 2019). Most of
42
+
these graphical models are Markov Random Field (MRF) models, whose graph
43
+
structure reflects the partial associations between variables
44
+
(Kindermann and Snell 1980). In these models, a missing edge between two
45
+
variables in the network implies that these variables are independent,
46
+
given the remaining variables (Lauritzen 2004). In other words, the
47
+
remaining variables of the network fully account for the potential
48
+
association between the unconnected variables.
17
49
18
50
## Why use a Bayesian approach to analyze the MRF?
19
51
20
-
Testing the structure of the MRF in a one-sample design requires us to determine the plausibility of the opposing hypotheses of conditional dependence and conditional independence. That is, how plausible is it that the observed data come from a network with a structure that includes the edge between two variables compared to a network structure that excludes that edge? Similarly, testing for group differences in the MRF in an independent-samples design requires us to determine the plausibility of the opposing hypotheses of parameter difference and parameter equivalence. That is, how plausible is it that the observed data come from MRFs with differences in specific edge weights or threshold parameters compared to MRFs that do not differ in these parameter?
21
-
22
-
Frequentist approaches are limited in this respect because they can only reject, not support, null hypotheses of conditional independence or parameter equivalence. This leads to the problem that if an edge is excluded, we do not know whether this is because the edge is absent in the population or because we do not have enough data to reject the null hypothesis of independence. Similarly, if a difference is excluded, we do not know whether this is because there is no difference in the parameter between the different groups or because we do not have enough data to reject the null hypothesis of parameter equivalence.
23
-
24
-
To avoid this problem, we will advocate a Bayesian approach using Bayes factors. In one-sample designs, the inclusion Bayes factor (Huth et al., 2023; Sekulovski et al., 2024) allows us to quantify how much the data support both conditional dependence -<em>evidence of edge presence</em> - or conditional independence -<em>evidence of edge absence</em>. It also allows us to conclude that there is limited support for either hypothesis - an <em>absence of evidence</em>. In independent-sample designs, they can be used to quantify how much the data support the hypotheses of parameter difference and equivalence. The output of the <strong>bgm</strong> and <strong>bgmCompare</strong> functions can be used to estimate these inclusion Bayes factors.
52
+
Testing the structure of the MRF in a one-sample design requires us to
53
+
determine the plausibility of the opposing hypotheses of conditional
54
+
dependence and conditional independence. That is, how plausible is it
55
+
that the observed data come from a network with a structure that
56
+
includes the edge between two variables compared to a network structure
57
+
that excludes that edge? Similarly, testing for group differences in the
58
+
MRF in an independent-samples design requires us to determine the
59
+
plausibility of the opposing hypotheses of parameter difference and
60
+
parameter equivalence. That is, how plausible is it that the observed
61
+
data come from MRFs with differences in specific edge weights or
62
+
threshold parameters compared to MRFs that do not differ in these
63
+
parameter?
64
+
65
+
Frequentist approaches are limited in this respect because they can only
66
+
reject, not support, null hypotheses of conditional independence or
67
+
parameter equivalence. This leads to the problem that if an edge is
68
+
excluded, we do not know whether this is because the edge is absent in
69
+
the population or because we do not have enough data to reject the null
70
+
hypothesis of independence. Similarly, if a difference is excluded, we
71
+
do not know whether this is because there is no difference in the
72
+
parameter between the different groups or because we do not have enough
73
+
data to reject the null hypothesis of parameter equivalence.
74
+
75
+
To avoid this problem, we will advocate a Bayesian approach using Bayes
76
+
factors. In one-sample designs, the inclusion Bayes factor (Huth et al.
77
+
2023; Sekulovski et al. 2024) allows us to quantify how much the data
78
+
support both conditional dependence -<em>evidence of edge
79
+
presence</em> - or conditional independence -<em>evidence of edge
80
+
absence</em>. It also allows us to conclude that there is limited
81
+
support for either hypothesis - an <em>absence of evidence</em>. In
82
+
independent-sample designs, they can be used to quantify how much the
83
+
data support the hypotheses of parameter difference and equivalence. The
84
+
output of the <strong>bgm</strong> and <strong>bgmCompare</strong>
85
+
functions can be used to estimate these inclusion Bayes factors.
0 commit comments