pylimma.non_estimable

pylimma.non_estimable(x, coef_names=None)[source]

Check for non-estimable coefficients in a design matrix.

Mirrors R’s limma::nonEstimable: runs a QR decomposition in original column order (qr(x, LAPACK=FALSE)), and if the design is rank-deficient returns the names of the redundant columns (the tail of qr$pivot). When no column names are available, falls back to 1-based string indices to match R’s colnames(x) <- as.character(1:p) default.

Parameters:
  • x (ndarray, DataFrame, or patsy DesignMatrix) – Design matrix. Column names are extracted when present.

  • coef_names (list of str, optional) – Explicit column names. Overrides any names carried on x. Use this when the caller has already converted the design to an anonymous ndarray but still has the original names.

Returns:

Names (or 1-based indices) of the non-estimable columns, or None when the design is full rank.

Return type:

list of str or None