Generalized hypergeometric ensembles (gHypEG) model multi-edge networks as edge samples drawn without replacement from an urn whose colours correspond to node pairs, with odds biased by a dyadic propensity matrix; the resulting adjacency distribution is the multivariate Wallenius noncentral hypergeometric distribution. The framework enables model selection and hypothesis testing via the Mahalanobis distance between an observed network and the ensemble, but three computational and analytic gaps in the founding formulation remain unresolved: (1) the expected adjacency matrix has no closed form and is obtained only by numerically solving nonlinear defining equations, a route that comes with no accuracy, stability or complexity guarantees at the scale of large networks under arbitrary propensities; (2) the adjacency covariance matrix is available only through Monte Carlo approximation; (3) the null distribution of the Mahalanobis test statistic admits a closed-form complementary cumulative distribution only in a restrictive asymptotic regime (uniform propensities and abundant urn capacities), so p-values are otherwise obtained by extensive sampling. Solving these problems — through closed-form expressions, certified scalable algorithms, or provably accurate analytic null distributions valid in realistic finite regimes — would convert gHypEG-based network hypothesis testing from a sampling-bound enterprise into an analytically tractable one.
Background
A central task in network science is to decide whether an observed topological pattern (e.g., a community structure or a tendency for particular pairs of nodes to interact) is statistically surprising once node degrees are accounted for. This requires null models: probability distributions over networks that preserve given aggregate statistics, such as the number of edges and (exactly or in expectation) the degree sequence. The classical configuration model fixes the degree sequence exactly and is usually sampled via random rewiring; soft-constrained alternatives such as the Chung–Lu model treat edges as independent. Both routes have drawbacks: exact rewiring gives no tractable likelihood, while independent-edge models cannot keep the number of edges fixed.
The generalized hypergeometric ensemble (gHypEG), introduced by Casiraghi, Nanumyan, Scholtes and Schweitzer in 2016, interpolates between these extremes. For a directed multi-edge network (one in which a pair of nodes can be joined by more than one edge, as in interaction or mobility data) with nodes and exactly edges, one constructs an urn: for each ordered pair of nodes the urn contains balls of a distinct colour, where and are the observed out- and in-degrees. Drawing balls from this urn without replacement generates the unbiased ensemble, whose adjacency distribution is the (central) multivariate hypergeometric distribution; the degrees are preserved in expectation while the number of edges is preserved exactly. Biasing the draws by a dyadic propensity matrix — each colour is drawn with relative odds , so that only the ratios are meaningful and is defined up to a common positive factor — yields the generalized ensemble, whose adjacency matrix follows the multivariate Wallenius noncentral hypergeometric distribution, i.e., the distribution of colour counts when balls are sampled without replacement with unequal odds. Arbitrary dyadic patterns (block or community structure, reciprocity effects, covariate-driven propensities) can be encoded through , which makes gHypEG a flexible family of analytically specified null models with a closed-form probability mass function (up to a one-dimensional numerical integral).
Statistical testing with gHypEG uses the squared Mahalanobis distance, a multivariate generalization of the z-score measuring how many standard deviations the observed adjacency matrix lies from the ensemble mean relative to the covariance matrix of the adjacency entries:
Because the number of edges is fixed — every realization satisfies — the covariance matrix is necessarily singular: the all-ones vector lies in its null space, so , in line with the degrees of freedom that appear below. The inverse in the quadratic form is accordingly understood as a generalized (Moore–Penrose) inverse, equivalently as the inverse of restricted to the hyperplane ; since implies that is almost surely constant, every generalized inverse gives the same value of .
A p-value for a hypothesis encoded by propensities is the complementary cumulative distribution function (ccdf) of under the corresponding ensemble, evaluated at the observation. Three computational obstructions arise from the routes adopted in the founding letter and persist through the framework's subsequent development; the letter itself presents them as matter-of-fact computational choices rather than as open problems. First, the mean of the multivariate Wallenius distribution is not available in closed form: it is characterized only implicitly, as the solution of a system of nonlinear equations for which the reference numerical methods are those of Fog (2008). In the definitive journal treatment that system (Corollary 5) equates the quantities over all dyads and adds the constraint , so all entries are determined by a single common constant and the whole expected adjacency matrix follows from one scalar root-find; the open issue is therefore not the number of solves, but the absence of any closed form and of published accuracy, stability and complexity guarantees for this numerical route on large networks under arbitrary . Second, the covariance matrix of the noncentral ensemble has no closed form either; the original work approximates it numerically via Fog's Monte Carlo sampling methods. Third, the ccdf of the Mahalanobis statistic has a known closed form only in a restrictive asymptotic regime — a limit with degrees of freedom that requires uniform propensities ( for all pairs) and urn capacities much larger than the number of edges () — so in general, p-values are obtained by simulating thousands of ensemble realizations. The companion software (the ghypernet R package) still obtains the expected adjacency matrix by numerical root-finding on the defining equations and computes p-values by (parallel) Monte Carlo sampling, with a multinomial approximation used as a heuristic fallback for large networks.
Problem Statement
For a generalized hypergeometric ensemble (gHypEG) on nodes with edges — the ensemble of adjacency matrices following the multivariate Wallenius noncentral hypergeometric distribution induced by a combinatorial urn matrix (with for observed degree sequences) and an arbitrary dyadic propensity matrix (positive entries, meaningful only up to a common positive factor) — make statistical inference analytically tractable by resolving three linked gaps that the founding formulation left to numerical and Monte Carlo treatment:
-
Expected adjacency matrix. Provide closed-form expressions for the entries in terms of , and , or alternatively an efficient, numerically stable algorithm with proven complexity and accuracy guarantees for computing on large networks under arbitrary , replacing the current implicit characterization of the mean as the solution of the defining nonlinear system (Fog's methods; Corollary 5 of the journal treatment, in which all dyads share a single common constant), which is obtained by numerical root-finding without any published certification.
-
Covariance structure. Provide analytic formulas for the covariance matrix of the adjacency entries (including cross-dyad covariances; is necessarily singular, of rank at most ) of the noncentral ensemble, or a scalable, provably accurate numerical scheme for , replacing Monte Carlo approximation as the only available route.
-
Null distribution of the test statistic. Derive the exact distribution, or general asymptotic distributions valid beyond the regime in which a closed-form ccdf is currently known (non-uniform , urn capacities not much larger than ), of the Mahalanobis goodness-of-fit statistic , with the generalized inverse described above, under a gHypEG null hypothesis — or provably accurate, computationally cheap approximations of its complementary cumulative distribution function — so that p-values for network hypothesis tests can be obtained without extensive sampling. Neither the founding letter nor its journal version specifies the complementary regime, so an answer must state the asymptotic scaling (or the finite-size conditions) in which its result holds, and the sense of its validity (limit theorem, non-asymptotic error bounds, or certified approximation).
These three components jointly serve one objective: sampling-free (or cheap and certified) statistical inference — model selection and hypothesis testing — with generalized hypergeometric ensembles at the scale of real empirical networks. An answer may resolve them through closed-form expressions, certified algorithms, or asymptotic theory rather than through unbounded Monte Carlo simulation. Throughout, 'arbitrary ' means any admissible propensity matrix, not only uniform or block-structured ones, and complexity or accuracy guarantees are understood per instance, with their dependence on , , and stated explicitly.
References
- Casiraghi, G., Nanumyan, V., Scholtes, I., Schweitzer, F. (2016). Generalized Hypergeometric Ensembles: Statistical Hypothesis Testing in Complex Networks. arXiv:1607.02441, DOI 10.48550/arXiv.1607.02441, https://arxiv.org/abs/1607.02441
- Casiraghi, G., Nanumyan, V., Scholtes, I., Schweitzer, F. (2017). From Relational Data to Graphs: Inferring Significant Links Using Generalized Hypergeometric Ensembles. Social Informatics (SocInfo 2017), Lecture Notes in Computer Science, pp. 111-120, DOI 10.1007/978-3-319-67256-4_11, https://doi.org/10.1007/978-3-319-67256-4_11
- Casiraghi, G., Nanumyan, V. (2021). Configuration models as an urn problem. Scientific Reports 11, 13416, DOI 10.1038/s41598-021-92519-y, https://doi.org/10.1038/s41598-021-92519-y
- Casiraghi, G. (2021). The likelihood-ratio test for multi-edge network models. Journal of Physics: Complexity 2(3), 035012, DOI 10.1088/2632-072X/ac0493, https://doi.org/10.1088/2632-072X/ac0493
- Casiraghi, G. (2019). The block-constrained configuration model. Applied Network Science 4, 123, DOI 10.1007/s41109-019-0241-1, https://doi.org/10.1007/s41109-019-0241-1
- Casiraghi, G., Andres, G. (2025). Empirical networks are sparse: Enhancing multiedge models with zero-inflation. PNAS Nexus 4(1), pgaf001 (online December 2024), DOI 10.1093/pnasnexus/pgaf001, https://doi.org/10.1093/pnasnexus/pgaf001
- Fog, A. (2008). Calculation Methods for Wallenius' Noncentral Hypergeometric Distribution. Communications in Statistics - Simulation and Computation 37(2), 258-273, DOI 10.1080/03610910701790269, https://doi.org/10.1080/03610910701790269
- Fog, A. (2008). Sampling Methods for Wallenius' and Fisher's Noncentral Hypergeometric Distributions. Communications in Statistics - Simulation and Computation 37(2), 241-257, DOI 10.1080/03610910701790236, https://doi.org/10.1080/03610910701790236
- Casiraghi, G., Nanumyan, V., with contributions from Brandenberger, L. and Vaccario, G. ghypernet: Fit and Simulate Generalised Hypergeometric Ensembles of Graphs. R package v1.1.2, CRAN (published 2026-02-04), DOI 10.32614/CRAN.package.ghypernet, https://cran.r-project.org/package=ghypernet
- Haines, L. M. (2025). Who's Afraid of the Wallenius Distribution? arXiv:2511.08088, DOI 10.48550/arXiv.2511.08088, https://arxiv.org/abs/2511.08088