Skip to contents

The dbn package implements a family of Dynamic Bilinear Network (DBN) models for temporal relational data. These models estimate how past network interactions shape future interactions, recovering time-varying influence structures that reveal which actors drive network dynamics and how those dynamics evolve.

The methodological framework is introduced in:

Salau, T. & Minhas, S. (under review). When Shocks Cascade: Time-Varying Propagation in Armed Conflict Networks.

The core idea

Many networks evolve over time: trade partners shift, alliances form and dissolve, conflict patterns reorganize. The central question is not just what does the network look like now, but how does the past network predict the future network, and how does that predictive mapping itself change over time?

All models in the dbn package share a common bilinear autoregressive structure:

Θt=AtΘt1Bt+M+εt\Theta_t = A_t \, \Theta_{t-1} \, B_t^\top + M + \varepsilon_t

The latent interaction state Θt\Theta_t is an n×nn \times n matrix of de-noised relational intensities at time tt. The sender dynamics matrix AtA_t captures how actors’ past behavior as senders influences future sending patterns, while the receiver dynamics matrix BtB_t captures how past targeting patterns influence future targets. The baseline mean MM absorbs persistent dyad-specific tendencies (stable rivalries, enduring alliances, reporting differences), and εt\varepsilon_t is matrix-normal innovation noise.

The bilinear form AtΘt1BtA_t \Theta_{t-1} B_t^\top means that each dyad’s future state depends on the entire past network, weighted by the sender and receiver influence matrices. This is what allows the model to capture propagation: a shock to one part of the network can ripple through the system via the estimated AtA_t and BtB_t operators.

Model variants

The package provides five model types that differ in how the influence matrices AA and BB behave over time. The right choice depends on the research question, the expected dynamics, and the network size.

Static model (model = "static")

The static model estimates fixed influence matrices AA and BB that are constant across all time periods. The latent network Θt\Theta_t still evolves over time, but the rules governing that evolution do not change. This variant is appropriate when you have relatively few time points or believe the influence structure is stable, when you have cross-sectional data, or when you want a baseline model to compare against time-varying alternatives.

The static model reveals who the influential senders and receivers are on average, which dyads have persistently strong or weak interactions after accounting for the baseline, and whether the bilinear lag structure explains variation beyond a simple mean model. Its key outputs include the posterior mean of AA, BB, and MM, scalar variance parameters (σ2\sigma^2, τA2\tau_A^2, τB2\tau_B^2), and convergence diagnostics. See the static vignette for a worked example with simulation recovery.

Dynamic model (model = "dynamic")

The dynamic model allows AtA_t and BtB_t to evolve over time via random walks (or optionally AR(1) processes). Each element of AA and BB can change from one period to the next, governed by innovation variances τA2\tau_A^2 and τB2\tau_B^2 that control how rapidly the influence structure reorganizes.

This variant is appropriate when the influence structure is expected to change over time and you want to identify when structural changes occur, not just that they occur. It supports time-indexed diagnostics (who is influential at each time point), impulse response functions for propagation analysis, multi-step-ahead forecasting, and dyad-level trajectories with posterior uncertainty. For very large networks (50+ actors), the low-rank variant offers better scalability.

The model produces influence snapshots (the combined weight matrix Wt=AtBtW_t = A_t B_t^\top at each time point), coupling trajectories (how tightly each actor’s behavior is predicted by the lagged network state), and propagation profiles via IRFs. Optional AR(1) persistence parameters ρA\rho_A and ρB\rho_B measure mean reversion in the influence structure. See the dynamic vignette for simulation recovery and the impulse response vignette for IRF analysis.

Piecewise model (model = "piecewise")

The piecewise model estimates block-constant influence matrices AkA_k and BkB_k for user-specified regimes k=1,,Kk = 1, \ldots, K. Within each regime, the influence structure is fixed; across regimes, it can differ arbitrarily. This model sits between the static and dynamic extremes.

It is appropriate when you know (or hypothesize) when structural breaks occurred and want interpretable regime-specific influence summaries. Typical applications involve comparing pre- and post-event periods around a known event such as a financial crisis, policy change, or conflict onset. The model also has memory advantages over the dynamic variant, since it estimates KK matrices instead of T1T-1. The compare_blocks() function quantifies regime differences with posterior uncertainty, providing direct evidence for whether the influence structure genuinely changed. See the piecewise vignette for a worked example including an applied analysis of UNGA voting around the 2008 financial crisis.

Low-rank model (model = "lowrank")

The low-rank variant factorizes the sender dynamics matrix as At=Udiag(αt)UA_t = U \, \text{diag}(\alpha_t) \, U^\top, reducing the parameter count from n2n^2 to n×r+rn \times r + r. This makes it scalable to larger networks (50+ actors). The columns of UU define latent groups of actors that share similar influence patterns, and αt\alpha_t captures how strongly each factor drives the dynamics at time tt. The receiver dynamics BtB_t remain fully estimated. See the low-rank vignette for examples with simulation recovery.

HMM model (model = "hmm")

The HMM variant replaces smooth evolution with discrete regime-switching: the network alternates between a small number of regimes (R=2R = 2–5), each with its own influence matrices, governed by a Markov transition matrix Π\Pi. The model estimates the regime labels sts_t alongside the dynamics, allowing data-driven discovery of structural breaks. See the HMM vignette for examples with regime recovery.

Choosing a model

For most applications, the choice is between the static, dynamic, and piecewise models:

Consideration Static Dynamic Piecewise
Influence structure changes over time
Few time points or cross-sectional
Breaks are discrete and known
Influence evolves smoothly
Want time-indexed diagnostics
Want interpretable regime summaries
Memory constraints (large networks)
Want impulse response analysis
Want forecasting

The static model is nested within the dynamic model (setting τA2=τB2=0\tau_A^2 = \tau_B^2 = 0 recovers it exactly), so the posterior of τA2\tau_A^2 itself serves as an informal diagnostic: if it concentrates near zero, the data favor a static structure. Similarly, piecewise with K=1K=1 is equivalent to static.

The low-rank and HMM variants extend the framework for specific use cases (large networks and regime-switching, respectively).

Outcome families

All model variants support three outcome types. The ordinal family (family = "ordinal") uses a rank likelihood that preserves the ordering of categorical data without requiring specific cutpoints. This is the most common choice for count-based relational data where the cardinal scale may not be meaningful. The Gaussian family (family = "gaussian") is appropriate for genuinely continuous outcomes and estimates an observation variance σY2\sigma_Y^2 that separates measurement noise from the latent process. The binary family (family = "binary") handles 0/1 outcomes via a probit link with data augmentation.

Bipartite and symmetric networks

When senders and receivers are distinct populations (such as countries sending aid to organizations), pass a rectangular array where n_row \neqn_col. The package automatically detects this and estimates AA as n_row ×\timesn_row (sender dynamics) and BB as n_col ×\timesn_col (receiver dynamics). Self-loops are retained since senders and receivers are distinct.

For undirected networks where the sender-receiver distinction is not meaningful, set symmetric = TRUE. This constrains B=AB = A, halving the parameter count.

Impulse response analysis

A distinctive feature of the bilinear framework is the ability to compute impulse response functions (IRFs) that trace how a shock to the network propagates through the estimated dynamics. Given a perturbation matrix SS applied at time t0t_0, the model propagates the shock forward through the sequence of estimated operators {At,Bt}\{A_t, B_t\} and tracks a network-level statistic (density, degree, reciprocity, transitivity) over subsequent horizons.

This answers questions like: if a specific bilateral relationship escalates, how does overall network density respond over the next several periods? Which actors’ escalations generate the broadest downstream consequences?

The paper introduces two key diagnostics built on this framework. Coupling trajectories measure how tightly each actor’s current behavior is predicted by the prior network state, measured by the row norms of the influence matrices. Actors with high coupling are structurally embedded in the lag dynamics; those with low coupling behave more idiosyncratically. Propagation profiles measure how broadly a standardized bilateral perturbation involving a given actor transmits through the wider system. High-coupling actors are not necessarily high-leverage actors: an actor can be predictable from the lag structure without generating large downstream spillovers.

Inference

All models use fully Bayesian MCMC inference with conjugate Gibbs sampling. The dynamic model exploits the bilinear structure to decompose the high-dimensional state-space problem into efficient row-wise Forward-Filtering Backward-Sampling (FFBS) passes. Instead of filtering in the full n2n^2-dimensional vectorized space, each row of AtA_t and BtB_t is updated via an independent nn-dimensional FFBS pass, reducing per-sweep cost from O(n4T)O(n^4 T) to O(n3T)O(n^3 T). The C++ backend supports optional multi-threaded computation via OpenMP (set with set_dbn_threads()), and automatic time-thinning and optional latent state compression manage memory for large problems. The estimate_memory() function checks RAM requirements before fitting, and check_convergence() provides built-in effective sample size and Geweke diagnostics.

Citation

If you use this package in your research, please cite:

Salau, T. & Minhas, S. (under review). When Shocks Cascade: Time-Varying Propagation in Armed Conflict Networks.

The package source code and documentation are available at https://github.com/netify-dev/dbn.