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:
- y
numpy.ndarray Observed coefficient vector \(Y = \hat{\beta} - \theta_0 e_{post,s}\) where \(\theta_0\) is the hypothesized value.
- sigma
numpy.ndarray Covariance matrix \(\Sigma\) of the event study coefficients.
- A
numpy.ndarray Constraint matrix \(A\) defining \(\Delta\).
- d
numpy.ndarray Constraint bounds \(d\) such that \(\Delta = \{\delta : A\delta \leq d\}\).
- alpha
float Significance level \(\alpha\) for the test.
- _precomputed
dict, optional Pre-computed A_tilde and d_tilde to avoid redundant computation in grid loops.
- **kwargs
Unused parameters for compatibility with hybrid tests.
- y
- Returns:
- bool
True if null is NOT rejected (i.e., \(\theta_0\) is in the confidence set).
References