The challenge of writing code is to see your horribleness on the page.
To see your terribleness and then go to bed.
And wake up the next day, and take that horribleness and terribleness,
and refine it, and make it not so terrible and not so horrible.
And then go to bed again.
And come the next day, and refine it a little bit more,
And make it not so bad and then go to bed the next day.
And do it again, again, again ....
And after many many agains make it maybe average.
And then one more time, if I am lucky,
Maybe it will be something usefull!!
Adapted from Ta-Nehisi Coates (Between the World and Me)
Within each section is a link to a description of the algorithm and toy examples of the computations. At the end is a 'work in progress'
C++ code to highlight how quick it is to generate the inverse for a large number of animals. The C++ code takes advantage of sparse
matrix storage (i.e., CSR) and hash tables for quick lookups. A link to all the R code functions can
be downloaded here.
Pedigree Based Functions
- Sorting and Renumbering a Pedigree R-Code
- Pedigree Relationship Matrix Inverse (A): Henderson 1976 R-Code
- Pedigree Relationship Matrix Inverse (A): Quaas 1976 R-Code
- Pedigree Relationship Matrix Inverse (A): Meuwissen & Luo 1992 R-Code
- Pedigree Relationship Matrix Inverse (A): Colleau 2002 R-Code
- Partial Inbreeding: Lacy 1996 R-Code
- Code Written in C++
Genomic Based Functions
- Genomic Relationship Matrix R-Code
- Genomic Relationship Matrix Inverse: Misztal et al. 2014 R-Code
- Genomic Relationship Matrix Inverse: Meyer et al. 2013 R-Code
- Combined Pedigree and Genomic Relationship Matrix: Legarra et al. 2009 R-Code
- Code Written in C++
Solving a Linear System of Equations
- Gibbs Sampling: Wang et al. 1993 R-Code
- Pre-Conditioned Conjugate Gradient (PCG) R-Code
- Code Written in C++
Optimization Algorithms
- Simulated Annealing R-Code
Machine Learning Functions
- Gradient Descent R-Code