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).

1 |

`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 |

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`

.

`A ` |
the A matrix in sparse matrix form |

`D ` |
the approximate D matrix in sparse matrix form |

`logDetD ` |
the log determinant of the approximate D matrix |

`Dinv ` |
the inverse of the approximate D matrix in sparse matrix form |

`listDinv ` |
the three column form of the non-zero elements for the inverse of the approximate D matrix |

`Dsim ` |
the simulated D matrix in sparse matrix form |

`logDetDsim ` |
the log determinant of the simulated D matrix |

`Dsiminv ` |
the inverse of the simulated D matrix in sparse matrix form |

`listDsim ` |
the three column form of the non-zero and non-self elements for the simulated D matrix |

`listDsiminv ` |
the three column form of the non-zero elements for the inverse of the simulated D matrix |

This simulation can take a long time for large values of `N`

. If unsure, it is advisable to start with a lower N and gradually increase to gain a sense of the time required to execute a desired `N`

.

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

1 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.