Skip to contents

Standardises each marker by its own \(\sqrt{2p(1-p)}\) before taking the cross-product.

Usage

morie_astle_balding_grm(marker_matrix, freq = NULL)

Arguments

marker_matrix

genotypes coded 0/1/2, individuals by markers.

freq

optional allele frequencies; estimated from the sample when NULL.

Value

list with G, n_markers_used, n_dropped, freq, mean_diagonal.

Details

The per-MARKER standardisation is what distinguishes this from VanRaden's, which divides the whole matrix by the total variance. Per marker up-weights rare variants: a variant at frequency 0.01 gets the same weight as one at 0.5 despite carrying far less information. That helps when rare variants genuinely carry signal and hurts when what they carry is genotyping error.

Frequencies estimated from the sample make the matrix sample-specific and not comparable across cohorts; supply freq from a reference panel when comparability matters.

References

Astle, W. and Balding, D. J. (2009). Population structure and cryptic relatedness in genetic association studies. Statistical Science, 24(4), 451-471.

Examples

if (requireNamespace("ranger", quietly = TRUE)) {
  set.seed(1)
  M <- matrix(rbinom(200, 2, 0.3), nrow = 20)
  round(mean(diag(morie_astle_balding_grm(M)$G)), 3)
}
#> [1] 0.871