Learn R Programming

nadiv (version 2.8)

makeDsim: Creates the dominance genetic relationship matrix through simulation

Description

Given a pedigree, the matrix of coefficients of fraternity are returned - the D matrix - as well as a simulated set of coefficients of fraternity (Ovaskainen et al. 2008).

Usage

makeDsim(pedigree, N, invertD = FALSE, calcSE = FALSE)

Arguments

pedigree
A pedigree with columns organized: ID, Dam, Sire
N
The number of times to simulate genotypes for the pedigree
invertD
A logical indicating whether or not to invert the D matrix
calcSE
A logical indicating whether or not the standard errors for each coefficient of fraternity should be calculated

Value

  • Athe A matrix in sparse matrix form
  • Dthe approximate D matrix in sparse matrix form
  • logDetDthe log determinant of the approximate D matrix
  • Dinvthe inverse of the approximate D matrix in sparse matrix form
  • listDinvthe three column form of the non-zero elements for the inverse of the approximate D matrix
  • Dsimthe simulated D matrix in sparse matrix form
  • logDetDsimthe log determinant of the simulated D matrix
  • Dsiminvthe inverse of the simulated D matrix in sparse matrix form
  • listDsimthe three column form of the non-zero and non-self elements for the simulated D matrix
  • listDsiminvthe three column form of the non-zero elements for the inverse of the simulated D matrix

Details

Missing parents (e.g., base population) should be denoted by either 'NA' or '0'.

Ovaskainen et al. (2008) indicated that the method of calculating the D matrix (see makeD) is only an approximation. They proposed a simulation method that is implemented here. This should be more appropriate when inbreeding occurs in the pedigree.

The value, listDsim will list both the approximate values (returned from makeD) as well as the simulated values. If calcSE is TRUE, these values will be listed in listDsim.

References

Ovaskainen, O., Cano, J.M., & Merila, J. 2008. A Bayesian framework for comparative quantitative genetics. Proceedings of the Royal Society B 275, 669-678.

See Also

makeD

Examples

Run this code
simDinvMat <- makeDsim(Mrode9, N = 1000, invertD = FALSE, calcSE = TRUE)$listDsim

Run the code above in your browser using DataLab