4.1.6.1.2. statsmodels.base.l1_solvers_common.qc_results

statsmodels.base.l1_solvers_common.qc_results(params, alpha, score, qc_tol, qc_verbose=False)[source]
Theory dictates that one of two conditions holds:
  1. abs(score[i]) == alpha[i] and params[i] != 0
  2. abs(score[i]) <= alpha[i] and params[i] == 0

qc_results checks to see that (ii) holds, within qc_tol

qc_results also checks for nan or results of the wrong shape.

Parameters:

params : np.ndarray

model parameters. Not including the added variables x_added.

alpha : np.ndarray

regularization coefficients

score : function

Gradient of unregularized objective function

qc_tol : float

Tolerance to hold conditions (i) and (ii) to for QC check.

qc_verbose : Boolean

If true, print out a full QC report upon failure

Returns:

passed : Boolean

True if QC check passed

qc_dict : Dictionary

Keys are fprime, alpha, params, passed_array