moderndid.test_in_identified_set_lf_hybrid#

moderndid.test_in_identified_set_lf_hybrid(y, sigma, A, d, alpha, hybrid_kappa, lf_cv, _precomputed=None, **kwargs)[source]#

Conditional-least favorable (LF) hybrid test.

Implements the conditional-LF hybrid test that combines a least favorable (LF) first stage with a conditional second stage. As described in [1], the distribution of \(\hat{\eta}\) under the null is bounded above (in the sense of first-order stochastic dominance) by the distribution when \(\tilde{\mu}(\bar{\theta}) = 0\).

The first stage uses a size-\(\kappa\) LF test that rejects when \(\hat{\eta} > c_{LF,\kappa}\), where \(c_{LF,\kappa}\) is the \(1-\kappa\) quantile of \(\max_{\gamma \in V(\Sigma)} \gamma' \xi\) with \(\xi \sim \mathcal{N}(0, \tilde{\Sigma}_n)\). This critical value can be calculated by simulation as it depends only on \(\tilde{\Sigma}_n\).

If the first stage does not reject, the second stage conducts a modified conditional test with size \(\frac{\alpha - \kappa}{1 - \kappa}\) that also conditions on the event \(\{\hat{\eta} \leq c_{LF,\kappa}\}\). The truncation upper bound becomes \(v_H^{up} = \min\{v^{up}, c_{LF,\kappa}\}\), ensuring the test conditions on passing the first stage.

This hybrid approach improves power when binding and non-binding moments are close together (relative to sampling variation) while maintaining exact size \(\alpha\) control.

Parameters:
ynumpy.ndarray

Observed coefficient vector \(Y = \hat{\beta} - \theta_0 e_{post,s}\).

sigmanumpy.ndarray

Covariance matrix \(\Sigma\).

Anumpy.ndarray

Constraint matrix \(A\).

dnumpy.ndarray

Constraint bounds \(d\).

alphafloat

Overall significance level \(\alpha\).

hybrid_kappafloat

First-stage significance level \(\kappa\), typically \(\alpha/10\).

lf_cvfloat

Least favorable critical value \(c_{LF}\) for first-stage test.

_precomputeddict, optional

Pre-computed A_tilde and d_tilde to avoid redundant computation in grid loops.

**kwargs

Unused parameters.

Returns:
bool

True if null is NOT rejected (value is in identified set).

References

[1]

Andrews, I., Roth, J., & Pakes, A. (2023). Inference for Linear Conditional Moment Inequalities. Review of Economic Studies.

[2]

Rambachan, A., & Roth, J. (2023). A more credible approach to parallel trends. Review of Economic Studies, 90(5), 2555-2591.