moderndid.folded_normal_quantile#

moderndid.folded_normal_quantile(p, mu=0.0, sd=1.0, seed=0)[source]#

Compute quantile of folded normal distribution \(cv_{\alpha}(t)\).

Computes the \(1-\alpha\) quantile of the folded normal distribution \(|N(t, 1)|\), denoted \(cv_{\alpha}(t)\) in the paper. This function arises in the FLCI construction through equation (18) in [1]

\[\chi_n(a, v; \alpha) = \sigma_{v,n} \cdot cv_{\alpha}(\bar{b}(a, v) / \sigma_{v,n}).\]

The folded normal is the distribution of \(|X|\) where \(X \sim N(\mu, \sigma^2)\). For the FLCI, we need this because the affine estimator has distribution

\[a + v'\hat{\beta}_n \sim N(a + v'\beta, v'\Sigma_n v),\]

and thus \(|a + v'\hat{\beta}_n - \theta| \sim |N(b, v'\Sigma_n v)|\) where \(b = a + v'\beta - \theta\) is the bias.

Parameters:
pfloat

Probability level (between 0 and 1), typically \(1 - \alpha\).

mufloat

Mean parameter \(t\) of the underlying normal distribution, equal to \(\bar{b}(a, v) / \sigma_{v,n}\) in the FLCI context.

sdfloat

Standard deviation of underlying normal (typically 1).

seedint

Random seed for Monte Carlo approximation.

Returns:
float

The value \(cv_p(t)\), the p-th quantile of \(|N(t, 1)|\).

Notes

When \(t = 0\), this reduces to the half-normal distribution. For non-zero \(t\), we use Monte Carlo simulation to approximate the quantile as no closed-form expression exists.

If \(t = \infty\), we define \(cv_{\alpha}(t) = \infty\) as noted in the paper (footnote 22).

References

[1]

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