Skip to content

Commit d99ac37

Browse files
fixed rank testing in groupwise_solve_lm
adapted to constraints
1 parent 8418e65 commit d99ac37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

batchglm/utils/linalg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ def apply_fun(grouping):
7373
# Get unqiue rows of design matrix and vector with group assignments:
7474
unique_design, inverse_idx = np.unique(dmat, axis=0, return_inverse=True)
7575

76-
if unique_design.shape[1] > np.linalg.matrix_rank(np.matmul(unique_design, constraints)):
76+
full_rank = constraints.shape[1]
77+
rank = np.linalg.matrix_rank(np.matmul(unique_design, constraints))
78+
if full_rank > rank:
7779
logger.error("model is not full rank!")
7880

7981
# Get group-wise means in linker space based on group assignments

0 commit comments

Comments
 (0)