Returns the largest violation of the graphical-lasso stationarity (KKT)
conditions. Because the objective is strictly convex, a value near zero
certifies the global optimum directly from the estimand, with no appeal to
any reference solver. For W = Theta^{-1} the subgradient conditions are
diagonal, unpenalised: \(W_{ii} = S_{ii}\);
diagonal, penalised: \(W_{ii} - S_{ii} = \rho_{ii}\);
off-diagonal with \(\Theta_{ij} \neq 0\): \(W_{ij} - S_{ij} = \rho_{ij}\,\mathrm{sign}(\Theta_{ij})\);
off-diagonal with \(\Theta_{ij} = 0\): \(|W_{ij} - S_{ij}| \le \rho_{ij}\).
Usage
glasso_kkt(
x,
S = NULL,
rho = NULL,
penalize_diagonal = NULL,
zero = NULL,
active_tol = 1e-08
)Arguments
- x
A
glasso_resultfromglasso_fit(), or a precision matrix.- S
Covariance the model was fit to. Required only when
xis a bare matrix; taken from the fit otherwise.- rho
Penalty (scalar or
p x pmatrix). Required only whenxis a bare matrix.- penalize_diagonal
Logical, whether the diagonal was penalised. Required only when
xis a bare matrix.- zero
Two-column matrix of hard-constrained
(row, col)index pairs, as passed toglasso_fit(). Taken from the fit whenxis aglasso_result. Constrained entries are excluded from the check: at a hard-constrained edge the inactive-edge inequality does not apply, because the equality constraint carries its own multiplier that absorbs the residual. Checking them anyway reports optimal fits as non-optimal.- active_tol
Magnitude above which an off-diagonal entry counts as active. Default
1e-8.
Value
A single non-negative number: the maximum absolute stationarity violation. Values near zero certify optimality.
Examples
set.seed(1)
x <- matrix(rnorm(200 * 4), ncol = 4)
fit <- glasso_fit(cov(x), rho = 0.05)
glasso_kkt(fit)
#> [1] 2.220446e-16