dualbounds.lee.compute_analytical_lee_bound¶
-
dualbounds.lee.compute_analytical_lee_bound(s0_probs, s1_probs, y0_dists=
None, y1_dists=None, y0_probs=None, y1_probs=None, y0_vals=None, y1_vals=None, m=1000)[source]¶ Helper function to compute semi-analytical Lee Bounds.
Unlike dual bounds, this function is not at all robust to model misspecification. The estimand is
\(E[Y(1) - Y(0) | S(0) = S(1) = 1]\)
where \(Y(1), Y(0)\) are potential outcomes and \(S(1), S(0)\) are post-treatment selection events.
- Parameters:¶
- s0_probs : np.array¶
n-length array where s0_probs[i] = P(S(0) = 1 | Xi)
- s1_probs : np.array¶
n-length array where s1_probs[i] = P(S(1) = 1 | Xi)
- y0_dists : np.array¶
batched scipy distribution of shape (n,) where the ith distribution is the conditional law of Yi(0) | S(0) = 1, Xi
- y1_dists : np.array¶
batched scipy distribution of shape (n,) where the ith distribution is the conditional law of Yi(1) | S(1) = 1, Xi
- y0_vals : np.array¶
nvals0-length array of values y0 can take.
- y0_probs : np.array¶
(n, nvals0)-length array where y0_probs[i, j] = P(Y(0) = yvals0[j] | S(0) = 1, Xi)
- y1_vals : np.array¶
(n,nvals1) array of values y1 can take.
- y1_probs : np.array¶
(n, nvals1) array where y0_probs[i, j] = P(Y(1) = yvals1[j] | S(1) = 1, Xi)
- m : int¶
Number of quantile discretizations to use when computing CVAR. m = 1000 (default) is more than sufficient.
- Returns:¶
agg_bounds (np.array) – (2,)-length array of lower and upper bound. This integrates across all n y0_dists/y1_dists, etc.
cond_bounds (np.array) – (2, n)-length array where bounds[0,i] is the ith lower bound and bounds[1,i] is the ith upper bound conditional on \(X_i\).