Dependency-free correctness certificate for a nodewise lasso, analogous to
glasso_kkt() for the graphical lasso. With standardized predictors X and
fitted mean mu (identity link for gaussian, logistic for binomial), the
subgradient conditions are \(n^{-1} X_j^\top (y - \mu) = \lambda\,
\mathrm{sign}(\beta_j)\) for active coordinates and
\(|n^{-1} X_j^\top (y - \mu)| \le \lambda\) otherwise. Near-zero certifies
the penalized-likelihood optimum.
Usage
glm_lasso_kkt(
X,
y,
b0,
beta,
lambda,
family = "gaussian",
weights = NULL,
active_tol = 1e-08
)Arguments
- X
Standardized predictor matrix (mean 0, unit variance columns).
- y
Response.
- b0
Fitted intercept.
- beta
Fitted (standardized) coefficients.
- lambda
Penalty.
- family
"gaussian"or"binomial".- weights
Optional observation weights (
NULL= unweighted).- active_tol
Magnitude above which a coefficient is "active".