Bayesian Exponential Random Graph Model

Statistics
Introduced by
Caimo, A., & Friel, N.
Year
2011
Type
Bayesian statistical model for networks
Family
Network science

What does it do?

The Bayesian Exponential Random Graph Model (Bayesian ERGM or BERGM) extends the classical ERGM framework by placing prior distributions over the model parameters and using Markov chain Monte Carlo methods to obtain full posterior distributions.

Introduced by Caimo and Friel (2011), it allows researchers to quantify parameter uncertainty and incorporate prior knowledge when modelling the structural features of social and other complex networks.

The intuition behind the method

A classical ERGM asks: given the observed network, which structural tendencies — such as reciprocity, transitivity, or degree distribution — are statistically significant? It answers with point estimates and standard errors. A Bayesian ERGM asks the same question but returns a full probability distribution over each parameter. This is like getting not just a single best guess but a whole landscape of plausible values, each weighted by how consistent it is with both the data and your prior beliefs. The result is richer uncertainty quantification, especially valuable when data are sparse or priors are informative.

History

The classical Exponential Random Graph Model is a family of models often called p* models, and its parameters have been difficult to estimate directly because of the intractable normalising constant. Caimo and Friel (2011) embedded ERGMs in a fully Bayesian framework, placing prior distributions on the parameters and sampling the posterior with MCMC, including an exchange-type algorithm for the intractable likelihood. Their work is the basis of the BERGM approach and the associated Bergm R package.

When to use it

Use Bayesian ERGM when you want to model the structural determinants of a single observed network — reciprocity, closure, degree heterogeneity — and need full posterior uncertainty rather than point estimates. It is especially appropriate when the network is relatively small, when prior information is available, or when you want to compare candidate specifications with Bayes factors, bearing in mind the computational caveats described under strengths and limitations. Feasibility depends on network size, density, the number of model terms and the MCMC settings, so it should be judged for each network rather than from a fixed size cutoff. Avoid it for very large networks where MCMC mixing may become prohibitive, or when the research question calls for predicting link formation over time rather than characterising a static network snapshot.

Limitations and considerations

  • Computationally intensive: the exchange-type MCMC simulates auxiliary networks at every iteration because the normalising constant is intractable, which makes it slow; the cost depends on network size, density and model complexity.
  • Priors need careful specification: ERGM parameters interact non-linearly with network density and with one another, so a prior that looks vague on the coefficient scale can imply strong beliefs about the density of the network. The implied network-level behaviour should be checked, for example by simulating networks from the prior.
  • Mixing and convergence of the MCMC chain can be difficult to achieve and to diagnose, particularly for complex model specifications.
  • Bayes factors are difficult to obtain for ERGMs, because the marginal likelihood depends on the intractable normalising constant. The estimation method and its approximation error should be reported, and Bayes factors are sensitive to the choice of prior.
  • Software support is narrower than for classical ERGM; the R package Bergm is the primary implementation.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Yields a full posterior distribution for each structural parameter, so uncertainty is reported as credible intervals rather than only as standard errors.
  • Lets prior information from theory or earlier studies enter the parameter estimates explicitly, so its influence can be examined through a prior sensitivity check.
  • Supports Bayes factors for comparing competing structural specifications, although their computation is demanding for ERGMs (see limitations), and supports posterior predictive checks of model fit.
  • Keeps the structural terms of the ERGM family, such as reciprocity, transitivity, k-stars, and covariate effects, so the Bayesian version does not restrict the model class.

Applications

  • Analysing friendship, advice, or collaboration networks in small organisations or classrooms where full uncertainty quantification on structural parameters is required.
  • Comparing structural hypotheses, such as triadic closure against degree-based preferential attachment, using Bayes factors, and reporting how the marginal likelihoods were estimated and how precise that estimate is.
  • Using prior estimates from an earlier wave or a related network to inform inference on a current network snapshot, with the prior stated explicitly.
  • Political science studies of voting coalitions or treaty networks, where networks are small and prior theory is strong.

How it works

How it works

1

The analyst selects a set of network statistics, such as the number of edges, triangles, two-paths, or degree-based terms, that represent the structural hypotheses of interest. Each statistic corresponds to one model parameter that captures a tendency in the network-formation process.

2

Prior distributions are placed over the model parameters. Vague priors are very diffuse and express minimal prior knowledge. Weakly informative priors are more concentrated than vague priors but do not encode detailed substantive beliefs. Informative priors encode substantive expectations from theory or earlier studies. These categories are distinct, and even vague or weakly informative priors can imply strong network-level behaviour, because ERGM parameters interact with network density. The choice of prior has a greater impact when the observed network is small.

Formula
p(\theta) \propto \text{prior distribution over } \theta
3

The ERGM likelihood is the exponential-family probability of the observed network given the parameter vector, divided by a normalising constant that sums over all possible networks of the same size. This constant is intractable for all but very small networks, so the likelihood cannot be computed directly.

Formula
P(Y=y|\theta) = \frac{\exp(\theta^\top s(y))}{\kappa(\theta)}
4

Because the normalising constant is intractable, Bayesian ERGM uses an exchange algorithm or another doubly intractable MCMC scheme that avoids direct evaluation of the constant. Auxiliary networks are simulated at each MCMC step, and the sampler is designed so that the intractable terms cancel. The result is a chain of parameter draws from the posterior.

5

Posterior samples are summarised as means, credible intervals, and density plots for each parameter. A credible interval is a range of parameter values that carries a stated posterior probability, given the model, the prior and the data. It is not a formal significance test. Whether it excludes zero is informative about the posterior under this model and prior, but it should not be read as a p-value or as proof of an effect, and it can change with the prior and the model specification. Posterior predictive distributions can then be computed to check how well the model reproduces observed network features.

Formula
p(\theta|y) \propto P(y|\theta)\,p(\theta)

Common pitfalls

  • Accepting MCMC output without checking trace plots and convergence diagnostics such as the Geweke statistic or Gelman-Rubin R-hat.
  • Using an overly complex model specification that induces near-degeneracy; starting with parsimonious statistics (edges, reciprocity, GWESP) is safer.
  • Interpreting posterior means as if they were maximum-likelihood estimates without examining the full posterior distribution.
  • Applying the method to large networks without first assessing whether MCMC will mix in a reasonable time.
  • Neglecting posterior predictive checks to verify that the fitted model actually reproduces key observed network properties.

Frequently asked questions

How does Bayesian ERGM differ from classical ERGM?

Classical ERGM uses maximum likelihood estimation (via MCMCMLE) and produces point estimates with standard errors. Bayesian ERGM places priors on the parameters and uses MCMC to obtain full posterior distributions, providing credible intervals and supporting formal model comparison via Bayes factors.

What software implements Bayesian ERGM?

The primary implementation is the R package Bergm (Caimo & Friel), which builds on the ergm package in the statnet suite. It provides functions for posterior sampling, convergence diagnostics, and posterior predictive goodness-of-fit checks.

How large a network can Bayesian ERGM handle?

There is no fixed node limit. Feasibility depends on network size, density, the number of model terms and the MCMC settings. Each MCMC step requires simulating auxiliary networks, so larger or denser networks make sampling slower, and mixing can deteriorate. Before relying on results, check empirically whether the chain mixes in a reasonable time using trace plots and effective sample sizes. If it does not, consider a simpler model or a different approach.

How should I choose priors?

Choose priors for the specific model and network rather than applying a generic default. Priors should be justified by theory, by earlier studies of comparable networks, or by a deliberate weakly informative choice. Because ERGM parameters interact with network density, check the behaviour a prior implies before relying on it, for example by simulating networks from the prior and examining their density and structural features. If you have results from a previous study or a related network, those estimates can inform a tighter prior, stated explicitly. Always perform a prior sensitivity check by refitting with a more diffuse prior to assess how much the posterior depends on the prior choice.

What goodness-of-fit diagnostics should I report?

Report posterior predictive distributions of key network statistics not included in the model, such as the geodesic distance distribution, triad census, or degree distribution, and compare them visually and numerically with the observed values. Also report MCMC trace plots and effective sample sizes for each parameter.

Related methods

Sources

  1. Caimo, A., & Friel, N. (2011). Bayesian inference for exponential random graph models. Social Networks, 33(1), 41–55.

    Open DOI reference
  2. Exponential random graph models. Wikipedia.

    Open publication reference