Skip to content

Commit cfa59c4

Browse files
committed
Fix glum issue-872. (Quantco#408)
1 parent 1b0ce40 commit cfa59c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tabmat/standardized_mat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ def sandwich(
155155

156156
limited_shift = self.shift[cols] if cols is not None else self.shift
157157
limited_d = d[rows] if rows is not None else d
158-
term3_and_4 = np.outer(limited_shift, d_mat + limited_shift * np.sum(limited_d))
159-
res = term2 + term3_and_4
158+
term3 = np.outer(limited_shift, d_mat)
159+
term4 = np.outer(limited_shift, limited_shift) * np.sum(limited_d)
160+
res = term2 + term3 + term4
160161
if isinstance(term1, sps.dia_matrix):
161162
idx = np.arange(res.shape[0])
162163
to_add = term1.data[0, :]

0 commit comments

Comments
 (0)