A dependency-free correctness certificate for a fitted Gaussian graphical model. For the convex objective $$\min_{\Theta \succ 0} -\log\det\Theta + \mathrm{tr}(S\Theta) + \rho \sum_{i \neq j} |\Theta_{ij}|$$ (off-diagonal penalty), let \(W = \Theta^{-1}\). The subgradient optimality conditions are \(W_{ii} = S_{ii}\); \(W_{ij} - S_{ij} = \rho\,\mathrm{sign}(\Theta_{ij})\) where \(\Theta_{ij} \neq 0\); and \(|W_{ij} - S_{ij}| \le \rho\) otherwise. By strict convexity, a precision matrix with zero violation is the unique global optimum, so a near-zero return certifies correctness independently of any reference solver.
Examples
S <- 0.5^abs(outer(1:5, 1:5, "-"))
fit <- ebic_glasso(cor_matrix = S, n = 200)
glasso_kkt(fit$precision, S, fit$lambda)
#> [1] 7.168638e-11