getA | R Documentation |
Returns the additive relationship matrix for the pedigree.
getA(ped, labs = NULL)
ped |
|
labs |
a character vector or a factor giving individual labels to
which to restrict the relationship matrix and corresponding factor. If
|
matrix (dsCMatrix
- symmetric sparse)
ped <- pedigree(sire = c(NA, NA, 1, 1, 4, 5),
dam = c(NA, NA, 2, NA, 3, 2),
label = 1:6)
(A <- getA(ped))
# Test for correctness
AExp <- matrix(data = c(1.0000, 0.0000, 0.5000, 0.5000, 0.5000, 0.2500,
0.0000, 1.0000, 0.5000, 0.0000, 0.2500, 0.6250,
0.5000, 0.5000, 1.0000, 0.2500, 0.6250, 0.5625,
0.5000, 0.0000, 0.2500, 1.0000, 0.6250, 0.3125,
0.5000, 0.2500, 0.6250, 0.6250, 1.1250, 0.6875,
0.2500, 0.6250, 0.5625, 0.3125, 0.6875, 1.1250),
byrow = TRUE, nrow = 6)
stopifnot(!any(abs(A - AExp) > .Machine$double.eps))
stopifnot(Matrix::isSymmetric(A))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.