Why Diagnose a Fitted Graph?
A sparse precision estimate can produce a plausible-looking graph without adequately describing the data. An omitted nonlinear relationship, a heavy-tailed variable, or a small number of unusual observations can affect both the fitted conditional distributions and the selected edges. Diagnostics therefore ask several distinct questions: do the conditional models leave systematic residual patterns, does the fitted distribution predict new observations well, do selected edges recur under resampling, and does a particular observation substantially change the fit?
These checks are complementary, not interchangeable. A graph can predict well while some individual edges are unstable, or an edge can recur reliably even when the Gaussian distribution misses tail behavior. In high dimensions, residuals and edge frequencies are also affected by estimation and tuning. They are evidence for assessing a model, not automatic certificates that it is correct.
Conditional Residuals
Let \(X\in\mathbb{R}^p\) have a multivariate Gaussian distribution with mean \(\mu\) and positive-definite precision matrix \(\Omega\), so its covariance matrix is \(\Omega^{-1}\). The conditional distribution of one coordinate given all the others is particularly useful for checking a Gaussian graphical model.
Under the model with its true parameters, each \(r_{ij}\) has a standard normal marginal distribution. The residual checks whether the observed coordinate is surprising given the other coordinates according to the fitted conditional model. Plotting residuals against fitted conditional means, other variables, or time can reveal trends, changing variance, clusters, or extreme tails that a Gaussian conditional distribution does not capture.
For a fitted model, replace \(\mu,\Omega\) by estimates. Training residuals are not exactly standard normal: the same observations helped determine those estimates, and regularization adds further dependence. When feasible, calculate diagnostics on held-out observations or use cross-fitting, in which each observation is evaluated using a model fitted without it. Examine residuals across variables and observations rather than interpreting one large value in isolation.
Worked Example: Computing Conditional Residuals
Suppose a two-variable model has known mean \(\mu=(0,0)\) and precision matrix \[ \Omega=\begin{pmatrix}1&-0.5\\-0.5&1\end{pmatrix}. \] For the observation \(x=(2,0)\), calculate both standardized conditional residuals.
For coordinate 1, the conditional mean given \(X_2=0\) is \(0-(-0.5)(0)=0\), and the conditional variance is \(1/\Omega_{11}=1\). Hence \(r_1=(2-0)/1=2\).
For coordinate 2, the conditional mean given \(X_1=2\) is \(0-(-0.5)(2)=1\), and the conditional variance is also 1. Hence \(r_2=(0-1)/1=-1\).
The observation is two conditional standard deviations above the fitted conditional mean for coordinate 1 and one below it for coordinate 2. The two residuals describe different conditional checks; they should not be treated as independent measurements.
Held-Out Log Likelihood
Residual plots are useful for finding particular patterns, while held-out likelihood summarizes predictive performance. Suppose a model fitted to training data gives mean \(\hat{\mu}\) and positive-definite precision estimate \(\hat{\Omega}\). Its log density for a held-out vector \(x\) is \[ \ell(x)=-\frac{p}{2}\log(2\pi)+\frac{1}{2}\log\det(\hat{\Omega})-\frac{1}{2}(x-\hat{\mu})^\mathsf{T}\hat{\Omega}(x-\hat{\mu}). \] For a held-out set, add these contributions or report their average. Larger average log likelihood means better predictive density on that set. All candidate models must be scored on the same held-out observations and with the same treatment of the mean and variables.
To verify the inequality, put \(U=p(X)/q(X)\) for \(X\sim q\), assuming \(p\) is positive wherever \(q\) is positive. Then \(E_q[U]\leq 1\), allowing for candidate probability outside the support of \(q\). Jensen's inequality for the concave logarithm gives \(E_q[\log U]\leq\log E_q[U]\leq 0\). Rearranging yields \(E_q[\log q(X)]-E_q[\log p(X)]\geq0\), which is the claimed result. Equality requires \(p=q\) \(q\)-almost everywhere. \(\square\)
This result concerns expected predictive score, not the score on every finite test set. A single held-out set can favor a worse model by chance. In high dimensions, the fitted precision must give a valid positive-definite density for this Gaussian score to be defined. Keep all fitting, scaling, and tuning decisions inside the training data; using held-out observations to choose the model makes the reported score optimistic.
Worked Example: Comparing Two Held-Out Scores
Compare two zero-mean bivariate Gaussian models on two held-out observations, \(x_1=(1,1)\) and \(x_2=(-1,-1)\). Model A has \(\Omega_A=I\); Model B has \[ \Omega_B=\begin{pmatrix}1&-0.5\\-0.5&1\end{pmatrix}. \]
For either observation, Model A has \(\log\det(\Omega_A)=0\) and quadratic form \(x^\mathsf{T}\Omega_Ax=2\). Its log score is \(-\log(2\pi)-1\), approximately \(-2.8379\).
For Model B, \(\det(\Omega_B)=1-0.25=0.75\). For \(x=(1,1)\), the quadratic form is \(1+1-2(0.5)=1\); for \(x=(-1,-1)\), it is also 1. Each log score is therefore \[ -\log(2\pi)+\frac12\log(0.75)-\frac12(1)\approx-2.4817. \] The average held-out score is approximately \(-2.8379\) for A and \(-2.4817\) for B, so B scores higher on these observations. This small test set is illustrative, not decisive evidence that B predicts better in general.
Edge Stability and Observation Influence
An edge in a fitted graph is a selected nonzero off-diagonal precision entry. Its recurrence across resamples is a useful sensitivity diagnostic. For a chosen resampling procedure, define the selection frequency of edge \((j,k)\) as the fraction of resampled fits in which that edge is selected. The procedure should specify the subsampling scheme, fitting method, and how tuning is chosen. If tuning is repeated within each resample, the frequency reflects the full selection pipeline; if tuning is fixed, it reflects stability conditional on that choice.
A high frequency indicates that an edge is relatively insensitive to the particular resamples used, not that the edge is certainly a true conditional dependence. Frequencies can change with sample size, tuning, scaling, or the resampling design. Compare the frequencies of scientifically important edges and inspect whether the same broader neighborhoods recur, rather than treating a universal cutoff as a guarantee.
Worked Example: Interpreting Edge Frequencies
A specified subsampling procedure produces 20 fitted graphs. Edge \((1,2)\) appears in 18 graphs, edge \((1,3)\) in 11, and edge \((2,3)\) in 4. Their selection frequencies are respectively \(18/20=0.90\), \(11/20=0.55\), and \(4/20=0.20\).
The evidence suggests that \((1,2)\) is more stable under this particular pipeline than the other two edges. The frequency 0.90 is not a 90% probability that the edge is true: it is a fraction of resampled fits, conditional on the data, the resampling design, and the fitting and tuning rules. The frequency 0.20 flags \((2,3)\) as especially sensitive and cautions against presenting it as a robust feature without further evidence.
An observation is influential when removing it and refitting materially changes quantities of interest, such as selected edges, estimated precision entries, or held-out predictions. An unusually large conditional residual can prompt this check, but unusualness alone does not establish influence. Conversely, a point may affect covariance structure without having an extreme residual under a model that has already been pulled toward it. A practical analysis records the change from the full fit to a leave-one-out fit and checks whether the change is large relative to ordinary resampling variation.
Worked Example: One Observation Creates a Selected Edge
Consider four centered observations in two dimensions: \((1,0),(-1,0),(0,1),(0,-1)\). Estimate the covariance with mean fixed at zero, using divisor \(n\). The covariance estimate is \[ \hat{\Sigma}=\frac14\sum_{i=1}^4x_ix_i^\mathsf{T} =\begin{pmatrix}0.5&0\\0&0.5\end{pmatrix}, \] so its inverse is diagonal and the fitted graph has no edge between the variables.
Now add the observation \((3,3)\) and again use mean zero and divisor \(n=5\). The new covariance estimate is \[ \hat{\Sigma}=\frac15\begin{pmatrix}11&9\\9&11\end{pmatrix} =\begin{pmatrix}2.2&1.8\\1.8&2.2\end{pmatrix}. \] Its determinant is \(2.2^2-1.8^2=1.6\), so it is positive definite. Its inverse is \[ \hat{\Omega}=\frac{1}{1.6}\begin{pmatrix}2.2&-1.8\\-1.8&2.2\end{pmatrix}, \] whose off-diagonal entries are \(-1.125\). The added observation changes the fitted graph from no edge to an edge in this unpenalized example. This is a concrete influence warning, not proof that the observation is erroneous: the model, mean assumption, and intended population all require scrutiny.
Common Pitfall and Practical Use
Wrong reasoning: “Every fitted conditional residual should be an independent standard normal, so I can flag every large training residual against a standard normal cutoff and trust the remaining graph.” This fails twice. Estimated training residuals are not independent standard normal observations, and checking many coordinates creates many chances for an apparently extreme value. In addition, a residual check does not establish that selected edges are stable or that new observations receive good predictive scores.
Correction: use held-out or cross-fitted residuals where possible, look for systematic patterns across observations and variables, and interpret extremes with the number of checks and the fitting procedure in mind. Pair those checks with held-out log likelihood, resampling-based edge stability, and targeted deletion refits for potentially influential cases. These diagnostics answer different questions and should be reported as such.
Check Your Understanding
Answer each question by referring to the assumptions and limitations of the diagnostic, not just its numerical output.
- What are the conditional mean and variance of \(X_j\mid X_{-j}\) in terms of the precision matrix?
- Why are fitted training conditional residuals not generally independent standard normal values?
- What does a higher average held-out log likelihood indicate, and why can one small test set still favor the poorer model?
- An edge appears in 19 of 20 resampled fits. What does this frequency support, and what does it not establish?
- Why is a large residual not, by itself, proof that an observation is influential?
- Give two distinct diagnostics you would use if an edge changes when one observation is removed.