Likelihood-ratio test for genetic covariance structure
Source:R/extractors.R
covariance_structure_lrt.RdValue
A one-row data frame with statistic, df, pvalue, boundary, and
the constrained / full genetic-structure labels.
Details
covariance_structure_lrt(constrained, full) is an experimental nested
likelihood-ratio test comparing two multivariate fits on the same
data: a constrained genetic structure (currently genetic_structure = "diagonal") against the full "unstructured" fit. The statistic is
2 * (logLik(full) - logLik(constrained)) on
df = n_genetic_params(full) - n_genetic_params(constrained).
For diagonal-vs-unstructured the null (off-diagonal genetic covariances = 0)
is interior, so the chi^2 reference is exact (boundary = FALSE). Structures
whose null lies on a rank/PSD boundary (low-rank / factor-analytic) would need
a chi^2-mixture correction and are gated out of the R bridge for now.
It mirrors the engine multivariate REML validation row (partial): asymptotic, REML-only,
dense validation-scale, with the multivariate recovery calibration not yet
passed – a reported test, not a validated one. Both fits must be on the same
response, fixed effects, and pedigree, and both must have converged. The
function refuses mismatched fits. A negative statistic or a comparison whose
null is on a boundary produces a warning and an NA p-value rather than a
misleading chi-square result.