Skip to content

Commit 69db787

Browse files
Readme update.
1 parent fd81547 commit 69db787

File tree

1 file changed

+16
-100
lines changed

1 file changed

+16
-100
lines changed

README.md

Lines changed: 16 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -6,55 +6,24 @@
66

77
# bgms: Bayesian Analysis of Graphical Models
88

9-
The `R` package <strong>bgms</strong> provides tools for Bayesian
10-
analysis of graphical models describing networks of variables. The
11-
package uses Markov chain Monte Carlo methods combined with a
12-
pseudolikelihood approach to estimate the posterior distribution of
13-
model parameters. Gibbs variable selection (George and McCulloch 1993)
14-
is used to model the underlying network structure of the graphical
15-
model. By imposing a discrete spike and slab prior on the pairwise
16-
interactions, it is possible to shrink the interactions to exactly zero.
17-
The Gibbs sampler embeds a Metropolis approach for mixtures of mutually
18-
singular distributions (Gottardo and Raftery 2008) to account for the
19-
discontinuity at zero. The goal is to provide these tools for Markov
20-
Random Field (MRF) models for a wide range of variable types in the
21-
<strong>bgms</strong> package, and it currently provides them for
22-
analyzing networks of binary and/or ordinal variables (Marsman and
23-
Haslbeck 2023).
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, and 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 a two independent samples design (cf., Marsman, Waldorp, Sekulovski, and 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.
12+
13+
In two independent samples designs, 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.
2414

2515
## Why use Markov Random Fields?
2616

27-
Multivariate analysis using graphical models has received much attention
28-
in the recent psychological and psychometric literature (Robinaugh et
29-
al. 2020; Marsman and Rhemtulla 2022; Contreras et al. 2019). Most of
30-
these graphical models are Markov Random Field (MRF) models, whose graph
31-
structure reflects the conditional associations between variables
32-
(Kindermann and Snell 1980). In these models, a missing edge between two
33-
variables in the network implies that these variables are independent,
34-
given the remaining variables (Lauritzen 2004). In other words, the
35-
remaining variables of the network fully account for the potential
36-
association between the unconnected variables.
17+
Multivariate analysis using graphical models has received much attention in the recent psychological and psychometric literature (Robinaugh et al. 2020; Marsman and Rhemtulla 2022; Contreras et al. 2019). Most of these graphical models are Markov Random Field (MRF) models, whose graph structure reflects the conditional associations between variables (Kindermann and 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.
3718

3819
## Why use a Bayesian approach to analyze the MRF?
3920

40-
Testing the structure of the MRF requires us to determine the
41-
plausibility of the opposing hypotheses of conditional dependence and
42-
conditional independence. That is, how plausible is it that the observed
43-
data come from a network with a structure that includes the edge between
44-
two variables compared to a network structure that excludes that edge?
45-
Frequentist approaches are limited in this regard because they can only
46-
reject the conditional independence hypothesis, not support it
47-
(Wagenmakers et al. 2018; Wagenmakers 2007). This leads to the problem
48-
that if an edge is excluded, we do not know whether this is because the
49-
edge is absent in the population or because we lack the power to reject
50-
the null hypothesis of independence. To avoid this problem, we will use
51-
a Bayesian approach using Bayes factors (Kass and Raftery 1995)). The
52-
inclusion Bayes factor (Huth et al. 2023; Sekulovski et al. 2024) allows
53-
us to quantify how much the data support both conditional dependence
54-
-<em>evidence of edge presence</em>- or conditional independence
55-
-<em>evidence of edge absence</em>. It also allows us to conclude that
56-
there is limited support for either hypothesis (Dienes 2014)-an
57-
<em>absence of evidence</em>.
21+
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 a two 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 two MRFs with a difference in the corresponding edge weight or threshold parameter compared to two MRFs that do not differ in this parameter?
22+
23+
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 two groups or because we do not have enough data to reject the null hypothesis of parameter equivalence.
24+
25+
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 two 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.
26+
5827

5928
## Installation
6029

@@ -80,31 +49,6 @@ Systematic Review.” *Psychotherapy and Psychosomatics* 88 (2): 71–83.
8049

8150
</div>
8251

83-
<div id="ref-Dienes_2014" class="csl-entry">
84-
85-
Dienes, Z. 2014. “Using Bayes to Get the Most Out of Non-Significant
86-
Results.” *Frontiers in Psychology* 5 (781): 1–17.
87-
<https://doi.org/10.3389/fpsyg.2014.00781>.
88-
89-
</div>
90-
91-
<div id="ref-GeorgeMcCulloch_1993" class="csl-entry">
92-
93-
George, E. I., and R. E. McCulloch. 1993. “Variable Selection via Gibbs
94-
Sampling.” *Journal of the American Statistical Association* 88 (423):
95-
881–89. <https://doi.org/10.1080/01621459.1993.10476353>.
96-
97-
</div>
98-
99-
<div id="ref-GottardoRaftery_2008" class="csl-entry">
100-
101-
Gottardo, R., and A. E. Raftery. 2008. “Markov Chain Monte Carlo with
102-
Mixtures of Mutually Singular Distributions.” *Journal of Computational
103-
and Graphical Statistics* 17 (4): 949–75.
104-
<https://doi.org/10.1198/106186008X386102>.
105-
106-
</div>
107-
10852
<div id="ref-HuthEtAl_2023_intro" class="csl-entry">
10953

11054
Huth, K., J. de Ron, A. E. Goudriaan, K. Luigjes, R. Mohammadi, R. J.
@@ -115,14 +59,6 @@ Methods and Practices in Psychological Science* 6 (4): 1–18.
11559

11660
</div>
11761

118-
<div id="ref-KassRaftery_1995" class="csl-entry">
119-
120-
Kass, R. E., and A. E. Raftery. 1995. “Bayes Factors.” *Journal of the
121-
American Statistical Association* 90 (430): 773–95.
122-
<https://doi.org/10.2307/2291091>.
123-
124-
</div>
125-
12662
<div id="ref-KindermannSnell1980" class="csl-entry">
12763

12864
Kindermann, R., and J. L. Snell. 1980. *Markov Random Fields and Their
@@ -138,11 +74,11 @@ Press.
13874

13975
</div>
14076

141-
<div id="ref-MarsmanHaslbeck_2023_OrdinalMRF" class="csl-entry">
77+
<div id="ref-MarsmanVandenBerghHaslbeck_inpress" class="csl-entry">
14278

143-
Marsman, M., and J. M. B. Haslbeck. 2023. “Bayesian Analysis of the
144-
Ordinal Markov Random Field.” *PsyArXiv*.
145-
<https://doi.org/10.31234/osf.io/ukwrf>.
79+
Marsman, M., van den Bergh, D. and J. M. B. Haslbeck. In press. “Bayesian Analysis of the
80+
Ordinal Markov Random Field.” *Psychometrika*.
81+
<https://doi.org/10.1017/psy.2024.4>.
14682

14783
</div>
14884

@@ -169,23 +105,3 @@ Robinaugh, D. J., R. H. A. Hoekstra, E. R. Toner, and D. Borsboom. 2020.
169105
Sekulovski N, Keetelaar S, Huth K, Wagenmakers E.-J, van Bork R, van den Bergh D, Marsman M (2024). “Testing conditional independence in psychometric networks: An analysis of three bayesian methods.” *Multivariate Behavioral Research*, 1–21. <doi:10.1080/00273171.2024.2345915>.
170106

171107
</div>
172-
173-
<div id="ref-Wagenmakers_2007" class="csl-entry">
174-
175-
Wagenmakers, E.-J. 2007. “A Practical Solution to the Pervasive Problems
176-
of p Values.” *Psychonomic Bulletin & Review* 14: 779–804.
177-
<https://doi.org/10.3758/BF03194105>.
178-
179-
</div>
180-
181-
<div id="ref-WagenmakersEtAl_2018_BIP1" class="csl-entry">
182-
183-
Wagenmakers, E.-J., M. Marsman, T. Jamil, A. Ly, J. Verhagen, J. Love,
184-
R. Selker, et al. 2018. “Bayesian Inference for Psychology. Part I:
185-
Theoretical Advantages and Practical Ramifications.” *Psychonomic
186-
Bulleting & Review* 25 (1): 58–76.
187-
<https://doi.org/10.3758/s13423-017-1343-3>.
188-
189-
</div>
190-
191-
</div>

0 commit comments

Comments
 (0)