moderndid.compute_conditional_cs_sdm#
- moderndid.compute_conditional_cs_sdm(betahat, sigma, num_pre_periods, num_post_periods, l_vec=None, m_bar=0, alpha=0.05, monotonicity_direction='increasing', hybrid_flag='FLCI', hybrid_kappa=None, post_period_moments_only=True, grid_points=1000, grid_lb=None, grid_ub=None, seed=None)[source]#
Compute conditional confidence set for \(\Delta^{SDI}(M)\).
Computes a confidence set for \(l'\tau_{post}\) that is valid conditional on the event study coefficients being in the identified set under the second differences with monotonicity restriction \(\Delta^{SDI}(M)\).
The combined smoothness and monotonicity restriction, denoted \(\Delta^{SDI}(M)\) in [2], is defined as the intersection of \(\Delta^{SD}(M)\) and a monotonicity restriction \(\Delta^I\)
\[\Delta^{SDI}(M) := \Delta^{SD}(M) \cap \Delta^{I},\]where
\[\Delta^{SD}(M) := \{\delta: |(\delta_{t+1} - \delta_t) - (\delta_t - \delta_{t-1})| \le M, \forall t\},\]and \(\Delta^{I} := \{\delta: \delta_t \ge \delta_{t-1}, \forall t\}\) for an increasing trend. For a decreasing trend, the restriction is \(\Delta^{SD}(M) \cap (-\Delta^{I})\).
This restriction is useful when economic theory suggests both smooth evolution of trends and monotonic behavior (e.g., secular trends expected to continue post-treatment). The intersection typically leads to smaller identified sets than using either restriction alone.
- Parameters:
- betahat
numpy.ndarray Estimated event study coefficients.
- sigma
numpy.ndarray Covariance matrix of betahat.
- num_pre_periods
int Number of pre-treatment periods.
- num_post_periods
int Number of post-treatment periods.
- l_vec
numpy.ndarray, optional Vector defining parameter of interest. If None, defaults to first post-period.
- m_bar
float, default=0 Smoothness parameter M for \(\Delta^{SDI}(M)\).
- alpha
float, default=0.05 Significance level.
- monotonicity_direction{‘increasing’, ‘decreasing’}, default=’increasing’
Direction of monotonicity restriction.
- hybrid_flag{‘FLCI’, ‘LF’, ‘ARP’}, default=’FLCI’
Type of hybrid test.
- hybrid_kappa
float, optional First-stage size for hybrid test. If None, defaults to alpha/10.
- post_period_moments_onlybool, default=True
If True, use only post-period moments for ARP test.
- grid_points
int, default=1000 Number of grid points for confidence interval search.
- grid_lb
float, optional Lower bound for grid search.
- grid_ub
float, optional Upper bound for grid search.
- seed
int, optional Random seed for reproducibility.
- betahat
- Returns:
Notes
\(\Delta^{SDI}(M)\) is a polyhedron formed by the intersection of smoothness and monotonicity constraints. The confidence set is constructed using either FLCIs or the moment inequality approach from Section 3 of [2].
As noted in [2], monotonicity restrictions are often motivated by economic arguments. For example, Lovenheim & Willen (2019) argue that pre-treatment trends in the “wrong direction” (opposite to treatment effects) support their findings.
Unlike \(\Delta^{SD}(M)\) alone, the optimal FLCI for \(\Delta^{SDI}(M)\) has the same worst-case bias as for \(\Delta^{SD}(M)\), meaning FLCIs do not adapt to the additional monotonicity restriction.
References