Computes the genomic variance component accounting account for linkage disequilibrium, which Lehermeier called Method 2 or "M2".

getM2varcomp(effects, varcovarmat, type)

Arguments

effects

vector of SNP effects

varcovarmat

square, symmetric var-covar matrix, estimator of LD between loci

type

string, "add" or "dom". If "dom" will square varcovarmat to get correct varcomp.

Value

additive or dominance genomic variance estimate accounting account for linkage disequilibrium

Details

Make sure **effects** and **varcovarmat** are in same order. This might use _alot_ of RAM and take _alot_ of time as it involves very large matrix operations. May be worth computing in an R session using multi-threaded BLAS

Examples

#> Error in is.data.frame(x): object 'M' not found
varcovarmat<-genoVarCovarMatFunc(Z)
#> Error in nrow(Z): object 'Z' not found
VarAddM2<-getM2varcomp(effects,varcovarmat,"add")
#> Error in t.default(effects): argument is not a matrix