Tutorials › Multivariate Statistics (Graduate) › Simulation Workshop: Evaluating Graph Recovery And Edge Uncertainty

Sparse Precision and Graphical Models · Tutorial 852 of 975

Simulation Workshop: Evaluating Graph Recovery And Edge Uncertainty

Learn how to build a controlled graph-recovery simulation and interpret its selection, estimation, and edge-interval results without confusing performance measures.

Advanced 11 min read

What You'll Learn

  • Construct a positive-definite sparse precision matrix with a controlled signal-strength parameter
  • Specify a simulation grid that separates sample-size effects from signal-strength effects
  • Compute support precision, recall, and normalized Frobenius error from a fitted graph
  • Evaluate marginal edgewise interval coverage and distinguish it from simultaneous coverage
  • Quantify Monte Carlo uncertainty in estimated performance measures
  • Recognize why tuning, thresholding, and post-selection reporting must be prespecified

Why Evaluate Graph Estimators by Simulation?

A sparse graph estimator is useful only to the extent that it recovers relevant edges and estimates their strengths under conditions resembling the intended application. A single fitted graph cannot reveal how often a method misses true edges, adds false ones, or produces intervals that fail to cover. A simulation makes these questions measurable because the generating precision matrix, and therefore its graph, are known.

A sound comparison changes one or more design factors systematically while holding the rest fixed. Here the central factors are sample size and edge signal strength. The outcomes include graph support precision and recall, matrix estimation error, and coverage of edgewise confidence intervals. These quantities answer different questions; none alone is a complete ranking of methods.

Definition: Let \(X_1,\ldots,X_n\) be independent observations from \(N_p(0,\Sigma)\), with positive-definite precision matrix \(\Theta=\Sigma^{-1}\). The true undirected graph has vertices \(1,\ldots,p\) and edge set \(E=\{(j,k):1\leq j<k\leq p,\ \Theta_{jk}\neq 0\}\). A fitted symmetric precision estimate \(\hat{\Theta}\) produces estimated edge set \(\hat{E}=\{(j,k):j<k,\ \hat{\Theta}_{jk}\neq 0\}\), after any prespecified thresholding rule.

Build a Controlled Data-Generating Model

The graph is encoded by the off-diagonal zeros of \(\Theta\), so a simulation can control graph structure directly by specifying \(\Theta\). It must also ensure that the matrix is positive definite. One convenient sufficient condition is strict diagonal dominance for a symmetric matrix with positive diagonal entries: if each diagonal entry exceeds the sum of the absolute off-diagonal entries in its row, the matrix is positive definite.

For a simple reproducible design, use a chain graph on \(p=50\) vertices. Set all diagonal entries to 2, and for each \(j=1,\ldots,49\), set \(\Theta_{j,j+1}=\Theta_{j+1,j}\) to \(0.4\) when \(j\) is odd and \(0.3\) when \(j\) is even. Set all other off-diagonal entries to zero. Multiply every nonzero off-diagonal entry by a signal-strength factor \(\gamma\in\{0.5,1,2\}\), leaving the diagonal fixed.

The largest absolute off-diagonal row sum before scaling is \(0.4+0.3=0.70\): an interior vertex between edges of those two sizes has that sum, and all other rows have a sum no larger than \(0.70\). At the largest signal level, the maximum is \(2(0.70)=1.40<2\). Thus the matrix is strictly diagonally dominant at every chosen signal level and is positive definite. This check matters: simulating from a purported precision matrix that is not positive definite does not define the intended Gaussian model.

For each design point, generate independent data sets from \(N_{50}(0,\Theta^{-1})\), using \(n\in\{50,100,200\}\). This gives nine combinations of sample size and signal strength. A larger study could add graph structures, such as hubs, but should report each structure separately rather than averaging unlike generating models into an opaque overall score.

Worked Example: Checking a Small Generating Matrix

Consider a four-vertex chain with diagonal entries 2 and off-diagonal entries \(\Theta_{12}=0.4\), \(\Theta_{23}=0.3\), and \(\Theta_{34}=0.2\), with symmetric counterparts and all remaining entries zero. The absolute off-diagonal row sums are

$$ r_1=0.4,\qquad r_2=0.4+0.3=0.70,\qquad r_3=0.3+0.2=0.50,\qquad r_4=0.2. $$

The largest row sum is \(0.70\), not \(0.50\). Every diagonal entry, 2, is larger than its row's absolute off-diagonal sum. Because the matrix is symmetric and strictly diagonally dominant with positive diagonal, it is positive definite. More specifically, the Gershgorin intervals place every eigenvalue at or above \(2-0.70=1.30>0\). The nonzero off-diagonal entries identify the three true edges \((1,2),(2,3),(3,4)\).

Specify Estimation and Scoring Before Simulating

Compare at least two procedures, for example graphical lasso and nodewise lasso with a prespecified symmetrization rule. The comparison is only interpretable if tuning and edge inclusion are fully specified. One workable plan is to select each method's penalty using a prespecified extended BIC rule on the same candidate penalty grid, then apply a fixed coefficient threshold \(\tau\) to define \(\hat{E}\). For nodewise regressions, state whether an undirected edge is selected by the OR rule (either endpoint selects the other) or the AND rule (both do). Do not choose the tuning rule after viewing which method performs best at a particular design point.

For each replicate, record true positives \(TP=|E\cap\hat{E}|\), false positives \(FP=|\hat{E}\setminus E|\), and false negatives \(FN=|E\setminus\hat{E}|\). Then compute support precision and recall. Precision is the fraction of estimated edges that are true; recall is the fraction of true edges that are recovered. If no edges are estimated, define precision as zero and flag that convention in the report. If the true graph has no edges, recall is undefined; this chain design avoids that case.

$$ \operatorname{Precision}=\frac{TP}{TP+FP},\qquad \operatorname{Recall}=\frac{TP}{TP+FN}. $$

For matrix error, one useful scale-adjusted measure is normalized Frobenius error, \(\|\hat{\Theta}-\Theta\|_F/\sqrt{p}\). It measures errors in all entries, not just mistakes in edge support; a separate off-diagonal error can be useful when diagonal accuracy is not the focus. Report which version is used. A method can have good support recall but poor coefficient estimates, or small matrix error while missing weak edges.

Worked Example: Computing Support Scores and Matrix Error

Suppose the true graph has edges \((1,2),(2,3),(3,4),(4,5)\), and the fitted graph has edges \((1,2),(2,3),(3,5),(4,5)\). Three estimated edges are true, one is false, and one true edge was missed. Therefore \(TP=3\), \(FP=1\), and \(FN=1\), so

$$ \operatorname{Precision}=\frac{3}{3+1}=0.75,\qquad \operatorname{Recall}=\frac{3}{3+1}=0.75. $$

Now suppose \(p=6\), the true edge coefficients in the order \((1,2),(2,3),(3,4),(4,5)\) are \(0.40,0.30,0.20,0.50\), and the corresponding fitted coefficients are \(0.35,0.25,0,0.45\). The false edge \((3,5)\) has fitted coefficient \(0.10\); assume all other entries, including diagonals, are exact. The five nonzero unordered-pair errors have magnitudes \(0.05,0.05,0.20,0.05,0.10\). Each off-diagonal error appears twice in the full symmetric matrix, so

$$ \|\hat{\Theta}-\Theta\|_F^2 =2(0.05^2+0.05^2+0.20^2+0.05^2+0.10^2) =2(0.0575)=0.115. $$

Thus \(\|\hat{\Theta}-\Theta\|_F=\sqrt{0.115}\approx0.3391\), and the normalized error is \(0.3391/\sqrt{6}\approx0.1385\). Both the false edge and the missed edge contribute to this coefficient error.

Evaluate Edgewise Interval Uncertainty

Graph selection and interval estimation are related but distinct tasks. For a concrete marginal interval assessment, one can prespecify a debiased precision estimator. Let \(S=n^{-1}\sum_{i=1}^n(X_i-\bar{X})(X_i-\bar{X})^\mathsf{T}\) be the sample covariance matrix, and let \(\hat{\Theta}\) be a symmetric initial sparse estimate. A commonly used debiasing step is

$$ \tilde{\Theta}=2\hat{\Theta}-\hat{\Theta}S\hat{\Theta}. $$

Under suitable high-dimensional regularity conditions, the off-diagonal entry \(\tilde{\Theta}_{jk}\) is approximately normal around \(\Theta_{jk}\). For Gaussian observations, the asymptotic variance for an off-diagonal precision entry has leading form \(\Theta_{jj}\Theta_{kk}+\Theta_{jk}^2\). A plug-in Wald interval is therefore

$$ \tilde{\Theta}_{jk}\ \pm\ 1.96 \sqrt{\frac{\hat{\Theta}_{jj}\hat{\Theta}_{kk}+\hat{\Theta}_{jk}^{\,2}}{n}}, \qquad j<k. $$

This is a marginal, nominal 95% interval, not a simultaneous confidence band for every edge. Its theoretical justification depends on the regime and regularity conditions; simulation coverage is an empirical diagnostic, not a proof that those conditions hold. To avoid selection-induced distortion, evaluate intervals for prespecified pairs, or for all pairs with true edges and null pairs separately, rather than reporting coverage only among edges selected from the same data.

For a set \(A\) of pairs, empirical coverage is the proportion of simulation replicates in which the interval contains the true coefficient. Report coverage for true edges and null edges as distinct summaries. For null edges the target is zero; for true edges the target is their nonzero coefficient. Also report average interval length, because very wide intervals can attain high coverage while conveying little precision.

Worked Example: Interpreting Coverage and Its Monte Carlo Error

Suppose 1,000 independent data sets are generated at one design point, and a prespecified interval for a particular true edge contains its true coefficient in 930 replicates. The estimated coverage is \(930/1000=0.93\). Treating each replicate's coverage indicator as Bernoulli with probability \(q\), the estimated Monte Carlo standard error is

$$ \sqrt{\frac{\hat q(1-\hat q)}{R}} =\sqrt{\frac{0.93(0.07)}{1000}} \approx0.0081. $$

The observed coverage is about two such standard errors below 0.95, a signal worth investigating but not by itself conclusive evidence of serious undercoverage. For comparison, when the true coverage is 0.95 and \(R=1000\), the Monte Carlo standard error is approximately \(\sqrt{0.95(0.05)/1000}=0.0069\).

In one replicate, suppose the true edge coefficient is 0.30 and its interval is \((0.18,0.42)\); this interval covers. A null pair with truth zero and interval \((-0.06,0.04)\) also covers. An interval \((0.31,0.44)\) for the 0.30 edge does not cover, since \(0.30<0.31\). Coverage is determined by comparing the true coefficient with the interval endpoints, not by whether zero is included.

Aggregate Results With Monte Carlo Uncertainty

Use \(R\) independent replicates at each combination of \(n\) and \(\gamma\), and retain replicate-level outcomes. For any performance statistic \(T_r\) from replicate \(r\), the average \(\bar{T}=R^{-1}\sum_{r=1}^R T_r\) estimates the expected performance under that fixed design. The following result explains why replication averages are appropriate.

Result: If \(T_1,\ldots,T_R\) are independent and identically distributed replicate-level statistics with finite expectation, then \(E[\bar{T}]=E[T_1]\). If they also have finite variance, then \(\operatorname{Var}(\bar{T})=\operatorname{Var}(T_1)/R\).

Proof. By linearity of expectation,

$$ E[\bar{T}] =E\left[\frac{1}{R}\sum_{r=1}^{R}T_r\right] =\frac{1}{R}\sum_{r=1}^{R}E[T_r] =E[T_1], $$

where identical distribution gives \(E[T_r]=E[T_1]\). Independence makes all cross-covariances zero, so

$$ \operatorname{Var}(\bar{T}) =\frac{1}{R^2}\sum_{r=1}^{R}\operatorname{Var}(T_r) =\frac{R\operatorname{Var}(T_1)}{R^2} =\frac{\operatorname{Var}(T_1)}{R}. $$

The sample standard deviation of the \(T_r\)'s divided by \(\sqrt{R}\) estimates the Monte Carlo standard error of the mean. For coverage, each indicator is Bernoulli, giving the estimated standard error \(\sqrt{\hat{q}(1-\hat{q})/R}\), as used above. More replicates reduce simulation noise; they do not repair a poorly chosen data-generating model or an unfair tuning comparison. \(\square\)

For each method, show results by sample size and signal strength, preferably in a table or plot with Monte Carlo error bars. Do not pool all nine conditions into one average: a method that excels at strong signals and large samples may fail badly for weak signals and small samples. Include the number of replicates, the tuning and symmetrization rules, the edge threshold, the interval procedure, and the definition of every reported metric.

Common Pitfalls and Interpretation

A common mistake is to treat a high recall value as proof of a good graph. A procedure that selects nearly every possible pair can recover almost all true edges, hence high recall, while having very low precision. Conversely, a method that selects only a few highly convincing edges can have high precision but low recall. Report both, alongside estimation error and uncertainty results.

A second mistake is to report confidence-interval coverage only for edges selected by the same data. Selection makes the reported set data-dependent, so ordinary marginal coverage need not persist after conditioning on selection. The correction is to define the target set in advance, report true-edge and null-pair coverage separately, and state clearly whether any selection adjustment or independent sample split is used. Likewise, marginal 95% coverage does not mean that all intervals jointly cover their targets with probability 0.95.

Finally, verify the generating model numerically as well as conceptually. Check symmetry, positive definiteness, and the intended edge support before drawing samples. For the chain design above, the largest base row sum is \(0.70\), and at \(\gamma=2\) it is \(1.40\), still less than the diagonal value 2. Rechecking such simple quantities prevents a simulation from answering a different question than the one intended.

Key takeaway: A useful graph-recovery simulation is a controlled experiment: specify a valid precision matrix, vary sample size and signal strength, prespecify fitting and scoring rules, and report support, coefficient error, interval coverage, and Monte Carlo uncertainty separately.

Check Your Understanding

Use these questions to check whether the design and its summaries are clear.

  1. Why does the row with entries 0.4 and 0.3 have absolute off-diagonal sum 0.70, and how does that help establish positive definiteness?
  2. A method estimates 8 true edges and 2 false edges, while missing 4 true edges. Calculate its support precision and recall.
  3. Why should edgewise interval coverage for true edges and null pairs usually be reported separately?
  4. For \(R=400\) replicates and estimated coverage \(\hat q=0.90\), calculate the estimated Monte Carlo standard error.
  5. Explain why a nominal 95% marginal interval procedure does not guarantee simultaneous 95% coverage across all graph pairs.
Clinical Biostats