Bayesian Gaussian Graphical Models - G-Wishart and Neighbourhood Selection

Summary

Concept note (no raw source). In a Gaussian graphical model the graph encodes zeros of the precision matrix . Bayesian options: (i) a G-Wishart prior on constrained to with a prior over graphs (exact but with an intractable normalising constant for non-decomposable ); (ii) continuous shrinkage on (graphical horseshoe/lasso; no explicit graph); (iii) neighbourhood selection, regressing each node on the others and combining edges with AND/OR rules. Used in PyMC example E19 (Sachs phosphoproteins).

Overview

Example list: https://redam94.github.io/pymc-challenges/examples.html, E19 (marginal vs partial correlation, LKJCholeskyCov, why a horseshoe on the precision matrix leaves the PD cone, Bayesian neighbourhood selection with node-wise horseshoe, AND/OR rules). Companion source: Li 2019 - Graphical Horseshoe Estimator - Overview.

Main Content

Gaussian graphical model (GGM)

with where . Partial correlation , in general different from the marginal correlation (two variables can be marginally correlated through a third and conditionally independent).

G-Wishart prior (Dawid & Lauritzen 1993; Roverato 2002)

For graph let be the cone of PD matrices with for non-edges. has density ; the normalising constant is closed-form for decomposable and requires Monte Carlo (Atay-Kayis & Massam 2005) or approximations for non-decomposable . Conjugacy: posterior is . Combined with a graph prior (e.g. i.i.d. Bernoulli edge inclusion), the graph posterior is ; samplers: reversible-jump (Dobra et al. 2011), birth-death MCMC (Mohammadi & Wit 2015), exchange/double-Metropolis for constants (Wang & Li 2012, Lenkoski 2013 direct sampler).

Neighbourhood selection (Meinshausen & Buhlmann 2006)

Regress on for each : , with . Estimate each neighbourhood by lasso (or a Bayesian shrinkage prior such as the horseshoe), then AND rule: edge iff both and ; OR rule: either. The Bayesian variant selects with credible intervals. Neighbourhood regressions are not jointly a valid precision matrix (not symmetric/PD) but give a consistent graph under sparsity.

Why a horseshoe directly on is awkward in a generic PPL: independent priors on entries do not enforce ; the graphical horseshoe handles it by column-wise conditionals that preserve PD (Li 2019 - Graphical Horseshoe Model and Gibbs Sampler). LKJ priors on correlation matrices give a PD matrix by construction but no sparsity, so use them for marginal-correlation models and post-hoc partial correlations.

Examples

Marginal vs partial correlation (3 variables, worked)

gives partial correlations , , but marginal correlations , , : variables 1 and 3 are marginally negatively correlated (via variable 2) though conditionally independent.

import numpy as np
Om = np.array([[2, -1, 0], [-1, 2.5, 0.8], [0, 0.8, 1.5]]); d = np.sqrt(np.diag(Om))
pc = -Om/np.outer(d, d); np.fill_diagonal(pc, 1); Sig = np.linalg.inv(Om)
mc = Sig/np.sqrt(np.outer(np.diag(Sig), np.diag(Sig))); print(np.round(pc, 3), np.round(mc, 3))

PyMC sketch (untested), node-wise horseshoe with AND rule on posterior inclusion:

import pymc as pm
def neighbourhood(Y, i, tau0=0.05):
    X = np.delete(Y, i, axis=1)
    with pm.Model():
        tau = pm.HalfStudentT("tau", 2, tau0); lam = pm.HalfCauchy("lam", 1, shape=X.shape[1])
        b = pm.Normal("b", 0, tau*lam, shape=X.shape[1]); s = pm.HalfNormal("s", 1)
        pm.Normal("y", X @ b, s, observed=Y[:, i]); return pm.sample(1000, tune=1000, progressbar=False)
# edge (i,j) kept (AND) if the 50%/90% interval of b_ij in node i's fit AND of b_ji in node j's fit exclude 0

Uncertainty note: use edge inclusion probabilities across draws rather than a single graph; compare with graphical-lasso stability selection (Stability Selection Setup - Structure Estimation with Lasso and Graphical Lasso).

Connections

See Also

Li 2019 - Graphical Horseshoe Estimator