Dmat | R Documentation |
Determine the diagonal factor in the decomposition of the relationship matrix A as TDT' where T is unit lower triangular.
Dmat(ped, vector = TRUE)
getD(ped, vector = TRUE)
getDInv(ped, vector = TRUE)
ped |
|
vector |
logical, return a vector or sparse matrix |
a numeric vector
getD()
: Mendelian sampling variance
getDInv()
: Mendelian sampling precision (= 1 / variance)
ped <- pedigree(sire = c(NA, NA, 1, 1, 4, 5),
dam = c(NA, NA, 2, NA, 3, 2),
label = 1:6)
(D <- getD(ped))
(DInv <- getDInv(ped))
# Test for correctness
DExp <- c(1.00, 1.00, 0.50, 0.75, 0.50, 0.46875)
stopifnot(!any(abs(D - DExp) > .Machine$double.eps))
DInvExp <- 1 / DExp
stopifnot(!any(abs(DInv - DInvExp) > .Machine$double.eps))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.