Skip to content

Commit d970ecc

Browse files
committed
update scores
1 parent 891a455 commit d970ecc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doubleml/double_ml_did_cs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ def _score_elements(self, y, d, t,
301301

302302
if self.score == 'observational':
303303
if self.in_sample_normalization:
304-
weight_psi_a = np.ones_like(y) # would be the same with np.divide(d, np.mean(d))
305-
weight_g_d1_t1 = np.divide(d, np.mean(d))
306-
weight_g_d1_t0 = -1.0 * weight_g_d1_t1
307-
weight_g_d0_t1 = -1.0 * weight_g_d1_t1
308-
weight_g_d0_t0 = weight_g_d1_t1
304+
weight_psi_a = np.divide(d, np.mean(d))
305+
weight_g_d1_t1 = weight_psi_a
306+
weight_g_d1_t0 = -1.0 * weight_psi_a
307+
weight_g_d0_t1 = -1.0 * weight_psi_a
308+
weight_g_d0_t0 = weight_psi_a
309309

310310
weight_resid_d1_t1 = np.divide(np.multiply(d, t),
311311
np.mean(np.multiply(d, t)))

doubleml/tests/_utils_did_cs_manual.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ def did_cs_score_elements(resid_d0_t0, resid_d0_t1, resid_d1_t0, resid_d1_t1,
160160

161161
if score == 'observational':
162162
if in_sample_normalization:
163-
weight_psi_a = np.ones_like(d)
164-
weight_g_d1_t1 = np.divide(d, np.mean(d))
165-
weight_g_d1_t0 = -1.0 * weight_g_d1_t1
166-
weight_g_d0_t1 = -1.0 * weight_g_d1_t1
167-
weight_g_d0_t0 = weight_g_d1_t1
163+
weight_psi_a = np.divide(d, np.mean(d))
164+
weight_g_d1_t1 = weight_psi_a
165+
weight_g_d1_t0 = -1.0 * weight_psi_a
166+
weight_g_d0_t1 = -1.0 * weight_psi_a
167+
weight_g_d0_t0 = weight_psi_a
168168

169169
weight_resid_d1_t1 = np.divide(np.multiply(d, t),
170170
np.mean(np.multiply(d, t)))

0 commit comments

Comments
 (0)