moderndid.test_in_identified_set#

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

Test whether \(\bar{\theta}\) lies in the identified set using the ARP conditional approach.

Tests the null hypothesis \(H_0: \theta = \bar{\theta}, \delta \in \Delta\) by checking whether the moment inequalities \(\mathbb{E}[\tilde{Y}_n(\bar{\theta}) - \tilde{X}\tilde{\tau}] \leq 0\) hold for some \(\tilde{\tau}\) (equation 13 in [2]). In the no-nuisance case where \(\bar{T} = 1\), there is no \(\tilde{\tau}\) to optimize over.

Following equations (14)-(15) in [2], the test statistic is the solution to the dual program

\[\hat{\eta} = \max_{\gamma} \gamma' \tilde{Y}_n(\bar{\theta}) \text{ s.t. } \gamma' \tilde{X} = 0, \gamma' \tilde{\sigma}_n = 1, \gamma \geq 0,\]

where \(\tilde{Y}_n(\bar{\theta}) = A\hat{\beta}_n - d - A L_{\text{post}}(\bar{\theta}, 0)'\) and \(\tilde{\sigma}_n = \sqrt{\text{diag}(A \Sigma_n A')}\). In the no-nuisance case, the constraint \(\gamma' \tilde{X} = 0\) is vacuous, so \(\hat{\eta}\) simplifies to \(\max_i (\tilde{Y}_n(\bar{\theta}))_i / \tilde{\sigma}_{n,i}\).

The test conditions on the event \(\{\gamma_* \in \hat{V}_n, S_n = s\}\) where \(\gamma_*\) is the optimal vertex. Under this conditioning, \(\hat{\eta}\) follows a truncated normal distribution with truncation bounds \([v^{lo}, v^{up}]\) that ensure \(\gamma_*\) remains optimal.

Parameters:
ynumpy.ndarray

Observed coefficient vector \(Y = \hat{\beta} - \theta_0 e_{post,s}\) where \(\theta_0\) is the hypothesized value.

sigmanumpy.ndarray

Covariance matrix \(\Sigma\) of the event study coefficients.

Anumpy.ndarray

Constraint matrix \(A\) defining \(\Delta\).

dnumpy.ndarray

Constraint bounds \(d\) such that \(\Delta = \{\delta : A\delta \leq d\}\).

alphafloat

Significance level \(\alpha\) for the test.

_precomputeddict, optional

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

**kwargs

Unused parameters for compatibility with hybrid tests.

Returns:
bool

True if null is NOT rejected (i.e., \(\theta_0\) is in the confidence set).

References

[1]

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

[2] (1,2)

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