Free SKILL.md scraped from GitHub. Clone the repo or copy the file directly into your Claude Code skills directory.
npx versuz@latest install hiyenwong-ai-collection-collection-skills-gaussian-graphical-connectivity-analysisgit clone https://github.com/hiyenwong/ai_collection.gitcp ai_collection/SKILL.MD ~/.claude/skills/hiyenwong-ai-collection-collection-skills-gaussian-graphical-connectivity-analysis/SKILL.md---
name: gaussian-graphical-connectivity-analysis
description: "Gaussian Graphical Models (GGMs) for functional brain connectivity analysis. Reviews and implements Graphical Lasso, neighborhood selection, and adaptive Lasso for estimating conditional dependence networks from fMRI data. Includes Alzheimer disease application. Activation: GGM brain connectivity, graphical lasso fMRI, functional connectivity, conditional dependence, precision matrix, neuroimaging statistics"
version: 1.0.0
author: Research Synthesis
license: MIT
metadata:
hermes:
tags: [brain-connectivity, GGM, fMRI, functional-connectivity, alzheimer, statistics]
source_paper: "Gaussian Graphical Models for Functional Connectivity Analysis (arXiv:2604.08946v1)"
citations: 0
published: "2026-04-11"
---
# Gaussian Graphical Models for Functional Connectivity Analysis
## Overview
Gaussian Graphical Models (GGMs) provide a principled statistical framework for estimating **functional brain connectivity** by capturing **conditional dependence** relationships among brain regions. Unlike correlation (which conflates direct and indirect connections), GGMs estimate the **precision matrix** (inverse covariance) where zero entries indicate conditional independence.
## Source Paper
- **Title:** Gaussian Graphical Models for Functional Connectivity Analysis: A Statistical Review with Applications to Alzheimer Disease
- **Authors:** Panpan Zhang, Shiying Xiao, W. Hudson Robb
- **arXiv:** 2604.08946v1
- **Published:** 2026-04-11
- **Categories:** stat.ME, stat.CO
## Core Concepts
### 1. Conditional Dependence vs. Correlation
- **Correlation**: marginal association (includes indirect paths)
- **Partial correlation** (precision matrix): direct association
- theta_ij = 0 means regions i, j are conditionally independent
### 2. Precision Matrix Estimation Methods
| Method | Approach | Strengths | Weaknesses |
|--------|----------|-----------|------------|
| Graphical Lasso | L1-regularized MLE | Automatic sparsity, convex | Uniform penalty |
| Neighborhood Selection | Per-node Lasso | Scalable, parallelizable | Asymmetric estimates |
| Adaptive Lasso | Weighted L1 | Oracle property | Requires initial estimate |
## Implementation
```python
import numpy as np
from sklearn.covariance import GraphicalLasso
from sklearn.linear_model import LassoLars
def graphical_lasso_connectivity(bold_data, alpha=0.1):
gl = GraphicalLasso(alpha=alpha, mode='cd', max_iter=100)
gl.fit(bold_data)
precision = gl.precision_
diag = np.sqrt(np.diag(precision))
partial_corr = -precision / np.outer(diag, diag)
np.fill_diagonal(partial_corr, 1.0)
return precision, partial_corr
def neighborhood_selection_connectivity(bold_data, alpha=0.1):
n_samples, n_regions = bold_data.shape
precision = np.zeros((n_regions, n_regions))
for j in range(n_regions):
y = bold_data[:, j]
X = np.delete(bold_data, j, axis=1)
lasso = LassoLars(alpha=alpha, max_iter=1000)
lasso.fit(X, y)
indices = np.delete(np.arange(n_regions), j)
precision[indices, j] = lasso.coef_
precision = (precision + precision.T) / 2
return precision, (np.abs(precision) > 0)
```
### Alzheimer Classification Pipeline
```python
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
def classify_alz_from_connectivity(precision_matrices, labels):
n_subjects = len(labels)
n_regions = precision_matrices.shape[1]
indices = np.triu_indices(n_regions, k=1)
features = precision_matrices[:, indices[0], indices[1]]
clf = RandomForestClassifier(n_estimators=100, random_state=42)
scores = cross_val_score(clf, features, labels, cv=5)
return clf, scores
```
## Method Comparison
| Scenario | Recommended | Reason |
|----------|-------------|--------|
| Small p, large n | Graphical Lasso | Full MLE, efficient |
| Large p | Neighborhood Selection | Scales linearly with p |
| Optimal selection | Adaptive Lasso | Oracle property |
## Activation Keywords
- GGM brain connectivity
- graphical lasso fMRI
- functional connectivity analysis
- conditional dependence network
- precision matrix estimation
- partial correlation fMRI
- brain network statistics
- Alzheimer connectivity
## Related Skills
- brain-graph-neural
- brain-connectivity-analysis
- brain-network-topology