R/l3o_variance.R
L3Ovar_gloop_cov.RdComputes the Leave-Three-Out (L3O) variance estimator (\(\hat{V}_{LM}\)) for the score statistic in a grouped instrument design with covariates. This function simultaneously calculates all five variance components by exploiting the block-diagonal symmetry of the projection matrices inherent to discrete instruments.
L3Ovar_gloop_cov(df, group, groupW, X, e, MX, Me)Data frame. Contains the variables used in estimation.
Column name (unquoted). The instrument grouping variable.
Column name (unquoted). The covariate stratification variable.
Column name (unquoted). The endogenous regressor.
Column name (unquoted). Residuals under the null hypothesis (\(Y - X\beta_0\)).
Column name (unquoted). Leverage-adjusted regressor (\(M_i X_i\)).
Column name (unquoted). Leverage-adjusted residual (\(M_i e_i\)).
Scalar. The estimated variance \(\hat{V}_{LM}\).
This function implements the variance estimator \(\hat{V}_{LM}\) for the Limited Information Maximum Likelihood (LIML) or UJIVE estimator. It computes: $$\hat{V} = A_1 + 2A_2 + A_3 - A_4 - A_5$$
Because the design implies symmetric weighting matrices (\(G_{ij} = G_{ji}\)), the function simplifies the asymmetric components.
Components:
A1, A2, A3: Variance and covariance of the score statistic. Calculated via 5 sub-components each.
A4, A5: Bias correction terms for "own-observation" variance contributions. Calculated via 4 sub-components each.