R/l3o_variance.R
L3Ovar_iloop_nocov.RdCalculates the Leave-Three-Out (L3O) variance estimator (\(\hat{V}_{LM}\)) for the score statistic in the "No Covariates" setting. Unlike the group-optimized functions, this implementation loops over every observation \(i\), making it suitable for any design where the weighting matrix is symmetric (\(G = P\)), even if it lacks a strict block-diagonal structure.
L3Ovar_iloop_nocov(X, e, P)Scalar. The estimated variance \(\hat{V}_{LM}\).
This function implements the variance estimator \(\hat{V}_{LM}\) under the assumption that there are no covariates, implying \(G = P\) and \(P\) is symmetric.
Specifically: The function iterates through each observation \(i\) (1 to \(N\)). Inside the loop, it:
Extracts the \(i\)-th column of \(P\) and \(M\).
Computes the L3O determinant adjustments \(D_{ijk}\) for all \(k\).
Calculates all five variance components (\(A_1 \dots A_5\)) simultaneously using pre-computed vector products to maximize efficiency.
This implementation is slower than L3Ovar_gloop_nocov for simple grouped designs but
is more general.