calculateBlockDiagonal2PhiMatrix: Kinship matrix of a known pedigree structure

View source: R/learnFamilyBasedPGMs.R

calculateBlockDiagonal2PhiMatrixR Documentation

Kinship matrix of a known pedigree structure

Description

Computes the block diagonal kinship matrix with the degree of relatedness between individuals all individuals of F families, multiplied by 2. It is usually denoted as 2 \bm\Phi, in which \bm \Phi = diag\{\Phi^{(f)}, f=1,\ldots,F\} and each entry \Phi^{(f)}_{ij} is the probability that two alleles sampled at random from individuals i and j of family f are identical by descent. Thus, when the pedigree structure is known, \Phi^{(f)}_{ii} = 1/2, \Phi^{(f)}_{ij} = 1/4 if i and j are siblings or if one of them is a parent of the other, \Phi^{(f)}_{ij} = 1/8 if one of them is a grand-parent of the other, and so on \insertCitelange2003mathematicalFamilyBasedPGMs.

Usage

calculateBlockDiagonal2PhiMatrix(ped, squaredRoot = FALSE,
  sampled = NULL)

Arguments

ped

A data.frame with with the pedigrees of the families, with columuns famid, id, dadid, momid, and sex for all sampled and non-sampled subjects.

squaredRoot

a logical value indicating if the square root of the kinship matrix 2 \bm\Phi (i.e., the Z matrix) must be computed.

sampled

A logical vector in which element i indicates whether individual i was sampled or not.

Value

The kinship matrix 2 \bm\Phi or its squared root, if squaredRoot is TRUE.

References

\insertAllCited

adele/FamilyBasedPGMs documentation built on June 11, 2025, 5:48 a.m.