relationshipAdditive       package:GeneticsPed       R Documentation

_A_d_d_i_t_i_v_e _r_e_l_a_t_i_o_n_s_h_i_p _m_a_t_r_i_x _a_n_d _i_t_s _i_n_v_e_r_s_e

_D_e_s_c_r_i_p_t_i_o_n:

     'relationshipAdditive' creates additive relationship matrix, while
     'inverseAdditive' creates its inverse directly from a pedigree.
     'kinship' is another definition of relationship and is equal to
     half of additive relationship.

_U_s_a_g_e:

     relationshipAdditive(x, sort=TRUE, names=TRUE, ...)
     inverseAdditive(x, sort=TRUE, names=TRUE, ...)
     kinship(x, sort=TRUE, names=TRUE, ...)

_A_r_g_u_m_e_n_t_s:

       x: Pedigree

    sort: logical, for the computation the pedigree needs to be sorted,
          but results are sorted back to original sorting (sort=TRUE)
          or not (sort=FALSE)

   names: logical, should returned matrix have row/colnames; this can
          be used to get leaner matrix

     ...: arguments for other methods

_D_e_t_a_i_l_s:

     Additive or numerator relationship matrix is symetric and contains
     1 + F_i on diagonal, where F_i is an inbreeding coefficients (see
     'inbreeding') for subject i. Off-diagonal elements represent
     numerator or relationship coefficient bewteen subjects i and j as
     defined by Wright (1922). Henderson (1976) showed a way to setup
     inverse of relationship matrix directly. Mrode (2005) has a very
     nice introduction to these concepts.

     Take care with 'sort=FALSE, names=FALSE'. It is your own
     responsibility to assure proper handling in this case.

_V_a_l_u_e:

     A matrix of n * n dimension, where n is number of subjects in 'x'

_A_u_t_h_o_r(_s):

     Gregor Gorjanc and Dave A. Henderson

_R_e_f_e_r_e_n_c_e_s:

     Henderson, C. R. (1976) A simple method for computing the inverse
     of a numerator relationship matrix used in prediction of breeding
     values. _Biometrics_ *32*(1):69-83

     Mrode, R. A. (2005) Linear models for the prediction of animal
     breeding values. 2nd edition. CAB International. ISBN
     0-85199-000-2 <URL: http://www.amazon.com/gp/product/0851990002>

     Wright, S. (1922) Coefficients of inbreeding and relationship.
     _American Naturalist_ 56:330-338

_S_e_e _A_l_s_o:

     'Pedigree', 'inbreeding' and 'geneFlowT'

_E_x_a_m_p_l_e_s:

       data(Mrode2.1)
       Mrode2.1$dtB <- as.Date(Mrode2.1$dtB)
       x2.1 <- Pedigree(x=Mrode2.1, subject="sub", ascendant=c("fat", "mot"),
                        ascendantSex=c("M", "F"), family="fam", sex="sex",
                        generation="gen", dtBirth="dtB")

       (A <- relationshipAdditive(x2.1))
       fractions(A)
       solve(A)
       inverseAdditive(x2.1)
       relationshipAdditive(x2.1[3:6, ])

       ## Compare the speed
       ped <- generatePedigree(nId=10, nGeneration=3, nFather=1, nMother=2)
       system.time(solve(relationshipAdditive(ped)))
       system.time(inverseAdditive(ped))

