Weighted Stochastic Block Model

Machine Learning
Introduced by
Aicher, C.; Jacobs, A. Z.; Clauset, A.
Year
2014
Type
Generative probabilistic model
Family
Network science

What does it do?

The Weighted Stochastic Block Model (W-SBM) extends the stochastic block model to networks whose edges carry numerical weights.

It assumes that the weight on an edge depends on the latent block memberships of its two nodes, and it jointly infers a partition of nodes into blocks and the block-pair weight parameters. Because it uses edge weights as well as edge presence, it can recover block structure that a model using only the presence or absence of edges may miss.

The intuition behind the method

In an unweighted network you can only ask which pairs of nodes are connected; in a weighted network you also know how strongly they are connected. The W-SBM treats edge weights as data generated by a probabilistic process: nodes belong to latent blocks, and each pair of blocks has its own weight distribution (for example Poisson for counts or normal for continuous values). Inference finds the block assignments and weight parameters that best explain the observed weights. Because the weights are modelled directly rather than thresholded, the grouping can depend on interaction strength as well as on connection topology.

History

Nowicki and Snijders (2001) proposed a Bayesian estimation approach, based on Gibbs sampling, for latent-class blockmodels of digraphs and valued digraphs, in which the relation between two vertices depends only on the classes they belong to. Aicher, Jacobs and Clauset (2014) extended the stochastic block model to edge weights drawn from any exponential family distribution and described a Bayesian variational algorithm for approximating the posterior over block structures. In their evaluation on the real-world weighted networks they tested, the WSBM performed as well as or better than the best alternatives on edge-existence and edge-weight prediction tasks.

When to use it

Use the W-SBM when your network has meaningful edge weights, such as interaction frequency, correlation strength, trade volume or similarity scores, and you want communities that reflect both connection pattern and weight heterogeneity. Aicher et al. evaluated the model on edge-existence and edge-weight prediction tasks for a set of real-world weighted networks. On those tasks and networks, the WSBM performed as well as or better than the best alternatives. This supports its use when weights carry information about structure, but performance on a specific network should be checked rather than assumed. Avoid the W-SBM when the edge weights are unreliable proxies (for example, heavily censored or coarsely binned values), when the network is very sparse and most weights are zero, or when you need a fast first pass, since simpler community-detection heuristics are cheaper to run.

Limitations and considerations

  • The likelihood does not select the number of blocks K; K must be chosen or searched with a criterion such as BIC, MDL or cross-validation, which multiplies the fitting cost.
  • Results depend on the chosen weight distribution. A misspecified family, for example Poisson weights for continuous data, can distort the recovered blocks.
  • Block labels are not identified in the basic model because they are arbitrary (Nowicki and Snijders); identifiability relies on invariant functions of the parameters or on prior constraints on some vertices.
  • Exact posterior inference is intractable for large networks, so practical fits rely on approximate algorithms whose accuracy depends on the approximation used.
  • Count families such as Poisson cannot represent negative weights, so signed networks need a different weight family or a model extension.

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

Strengths

  • Uses edge weights as well as edge presence, so block structure that depends on interaction strength can be recovered where a binary model would discard it.
  • As a generative model with a likelihood, it supports formal comparison of fits with different numbers of blocks, for example by BIC or MDL, and posterior probabilities for block membership.
  • The framework covers weight distributions from any exponential family, so count, continuous and other weight types can be modelled within one block structure.
  • Prior information about the class membership of some vertices can identify otherwise arbitrary block labels. This device was developed for latent-class blockmodels by Nowicki and Snijders; whether a given W-SBM implementation supports it depends on its priors.
  • The block-pair parameters are not constrained to a diagonal pattern, so both assortative and disassortative block patterns can be represented.

Applications

  • Community detection in social networks where edge weights encode interaction frequency or tie strength.
  • Functional-module detection in biological networks where weights encode interaction or co-expression strength, such as gene co-expression or protein interaction data.
  • Grouping countries or economic units from bilateral trade-flow matrices, where trade volume is the edge weight.
  • Segmenting correlation or similarity networks, where the weight is a correlation or similarity score.
  • Benchmarking and comparing community-detection algorithms on weighted synthetic networks generated from the model.

How it works

How it works

1

Choose a probability distribution appropriate for the edge weights in your network, such as Poisson for count data (for example, frequency of interaction), a normal or log-normal distribution for continuous measurements, or Bernoulli for binary edges. Each block pair (r, s) has its own parameter governing the distribution of weights on edges between block-r and block-s nodes. Before fitting, check the data. Decide whether the network is directed or undirected and use a model that matches that choice. Decide explicitly how self-loops are handled, since they contribute to within-block weights. Decide how zero-weight and absent pairs are coded, because this changes the estimated block-pair parameters (see the Poisson rate in the next step). Compare the empirical weight distribution with the chosen family before fitting.

2

Each node is assigned a latent block label. Starting labels may be random or come from a heuristic initialisation. The number of blocks K must be specified or varied across model fits.

3

Given the current block assignments, block-pair weight parameters are estimated by maximising the likelihood (or, in Bayesian variants, the posterior) of the observed weights. For Poisson weights, the maximum-likelihood rate for a block pair is the total weight in that block pair divided by the number of node pairs in it, counting pairs with zero weight.

Formula
\hat{\theta} = \arg\max_{\theta} \, p(A \mid z, \theta)
4

Block assignments are updated by computing, for each node, its posterior probability of belonging to each block, given its observed edge weights and the current parameters. This is an expectation-maximisation-type or variational update; the Bayesian variational algorithm described by Aicher et al. approximates the posterior over block structures in this way. The process repeats until assignments stabilise. Read the output as follows. Membership probabilities are posteriors over blocks rather than hard labels, so a node whose probabilities are spread across blocks is ambiguous. Each block-pair parameter is the fitted parameter of the chosen distribution for edges between those two blocks; for Poisson weights it is the mean rate, that is, the expected weight per node pair. Because fitting can reach local optima, run several random starts and check that the solutions agree before interpreting the blocks.

5

The number of blocks K is not given by the data. Compare fits for different values of K using the Bayesian Information Criterion (BIC), minimum description length (MDL), or cross-validation. The risk of overfitting increases with K relative to network size.

Common pitfalls

  • Fixing K without fitting alternative values and comparing them with BIC, MDL or cross-validation.
  • Applying Poisson weights to continuous or real-valued data. Match the distribution family to the process that generated the weights.
  • Ignoring convergence: variational and EM-type fitting can settle at local optima, so run several random starts and compare the results.
  • Treating block labels as fixed categories across independent network snapshots without accounting for label switching, which the basic model leaves unidentified (Nowicki and Snijders).
  • Conflating the W-SBM with modularity maximisation. The W-SBM is a generative model with a likelihood, not an optimisation of a heuristic quality function.

Frequently asked questions

How do I choose the right weight distribution?

Match the distribution to your data: Poisson for non-negative integer counts, normal for symmetric real-valued weights, log-normal or gamma for positive skewed weights. Plot the empirical weight distribution and fit candidate families; use likelihood or BIC to select.

How many blocks should I use?

There is no universally correct answer. Fit the model over a range of candidate K values around the number of communities you think is plausible, and compare the fits using BIC or cross-validated held-out likelihood. Larger K requires more data per block to estimate weight parameters reliably.

Is W-SBM the same as weighted modularity maximisation?

No. Weighted modularity maximisation optimises a heuristic quality function and does not assume a generative model. W-SBM defines a probabilistic data-generating process with a likelihood, which supports formal model comparison.

What software can I use?

Check each implementation's documentation for support of weighted edges and for the weight family you need, and confirm the inference method it uses.

Can W-SBM handle directed weighted networks?

Nowicki and Snijders (2001) treat digraphs and valued digraphs, where the relation from one vertex to another depends on their classes. The same ordered-pair parameterisation can be extended to directed weighted networks, but whether a particular W-SBM implementation accepts directed weighted input should be checked in its documentation before use.

Related methods

Sources

  1. Aicher, C., Jacobs, A. Z., & Clauset, A. (2014). Learning latent block structure in weighted networks. Journal of Complex Networks, 3(2), 221–248.

    Open DOI reference
  2. Nowicki, K., & Snijders, T. A. B. (2001). Estimation and prediction for stochastic blockstructures. Journal of the American Statistical Association, 96(455), 1077–1087.

    Open DOI reference