Chapter 8 Notes

8.1 APY

APY is application of blockwise matrix inversion, or wiki link

\[ \begin{bmatrix} P_{11} & P_{12}\\ P_{21} & P_{22} \end{bmatrix} ^{-1} = \begin{bmatrix} P_{11}^-1+P_{11}^{-1}P_{12}F^{-1}P_{21}P_{11}^{-1}&P_{11}^{-1}P_{12}F^{-1}\\ F^{-1}P_{21}P_{11}^{-1}&F^{-1} \end{bmatrix}\]

in which \(F=P_{22}-P_{21}P_{11}^{-1}P_{12}\) is assumed nonsingular.

A much original idea of APY resembles Quaas and Pollak (J Anim Sci, 1980, 51:1277-87), an example of which can be found in Lynch&Walsh page 759-61.

\(G^{-1}= \left[ \begin{matrix} I& -P_{cn}\\ 0&I \end{matrix} \right] \left[ \begin{matrix} G_{cc}^{-1}& 0\\ 0&M_{nn}^{-1} \end{matrix} \right] \left[ \begin{matrix} I& 0\\ -P_{nc}&I \end{matrix} \right] = \left[ \begin{matrix}G_{cc}^{-1}&-P_{cn}M_{nn}^{-1}\\ 0&M^{-1}_{nn} \end{matrix} \right] \left[ \begin{matrix}I&0\\ -P_{nc}&I \end{matrix} \right]\)

Citation: Misztal, I, 2016, Inexpensive computation of the inverse of the genomic relationship matrix in populations with small effective population size, \(Genetics\), 202:401-409.

in which \(G\) is the numerical relationship matrix, and \(P_{cn}=G_{cc}^{-1}G_{cn}\) and \(P_{nc}=G_{nc}G_{cc}^{-1}\). \(G_{cc}\), \(G_{cn}\), and \(G_{nc}\) (\(G_{cn}=G_{nc}\)) are, “core” to “core”, “core” to “non-core”, and “non-core” to “core” relationship matrix.

\(M_{nn}=diag(G_{nn})-diag(P_{cn}^TG_{cn})\)

8.1.1 A numerical example

This example is taken from appendix in Misztal’s paper.

\(G=\left[ \begin{matrix} 0.81 & 0 & 0 & 0.80 & -0.80\\ &0.81 & 0 & 0.80 &-0.80\\ & & 0.01& 0 & 0\\ & & & 1.61 & -1.60\\ symm. & & & & 1.61 \end{matrix} \right]\)

and \(G_{cc}^{-1}=\left[ \begin{matrix} 1.235 & 0\\ 0 & 1.235 \end{matrix} \right]\)

\(G_{cn}=G_{nc}^T=\left [ \begin{matrix} 0 & 0.80 & -0.80\\ 0 & 0.80 & -0.80 \end{matrix} \right]\)

and

\(P_{cn}=G_{cc}^{-1}G_{cn}=\left [ \begin{matrix} 0.00 & 0.988 & -0.988\\ 0.00 & 0.988 & -0.988 \end{matrix} \right ]\)

\(M_{nn}=diag(G_{nn})-diag(P_{cn}^TG_{cn}) = \left [ \begin{matrix}0.01 & &\\ & 1.61 & \\ & & 1.61 \end{matrix} \right] - \left [ \begin{matrix}0.00 & &\\ & 1.58 & \\ & & 1.58 \end{matrix} \right]=\left [ \begin{matrix}0.01 & &\\ & 0.03 & \\ & & 0.03 \end{matrix} \right]\)

and

\(G^{-1}=\left[ \begin{matrix} 66.8 & 65.5 & 0 & -33.1 & 33.1\\ &66.804 & 0 & -33.1 & 33.1\\ & & 100& 0 & 0\\ & & & 33.6 & 0\\ symm. & & & & 33.6 \end{matrix} \right]\)

This is APY inversed \(G\), and for a comparison, a regular inverse of \(G\) is quit different \(G^{-1}_{reg}=\left[ \begin{matrix} 40.6 & 39.4 & 0 & -19.9 & 19.9\\ &40.6 & 0 & -19.9 & 19.9\\ & & 100& 0 & 0\\ & & & 60.0 & 39.9\\ symm. & & & & 60.0 \end{matrix} \right]\)

##       [,1]  [,2] [,3]  [,4]  [,5]
## [1,]  0.81  0.00 0.00  0.80 -0.80
## [2,]  0.00  0.81 0.00  0.80 -0.80
## [3,]  0.00  0.00 0.01  0.00  0.00
## [4,]  0.80  0.80 0.00  1.61 -1.60
## [5,] -0.80 -0.80 0.00 -1.60  1.61
##           [,1]      [,2] [,3]      [,4]     [,5]
## [1,]  40.64222  39.40765    0 -19.95012 19.95012
## [2,]  39.40765  40.64222    0 -19.95012 19.95012
## [3,]   0.00000   0.00000  100   0.00000  0.00000
## [4,] -19.95012 -19.95012    0  60.09975 39.90025
## [5,]  19.95012  19.95012    0  39.90025 60.09975
##           [,1]      [,2] [,3]      [,4]     [,5]
## [1,]  66.80498  65.57041    0 -33.19502 33.19502
## [2,]  65.57041  66.80498    0 -33.19502 33.19502
## [3,]   0.00000   0.00000  100   0.00000  0.00000
## [4,] -33.19502 -33.19502    0  33.60996  0.00000
## [5,]  33.19502  33.19502    0   0.00000 33.60996
##               [,1]          [,2] [,3]      [,4]      [,5]
## [1,]  8.100000e-01  9.572467e-16 0.00  0.800000 -0.800000
## [2,]  1.089201e-15  8.100000e-01 0.00  0.800000 -0.800000
## [3,]  0.000000e+00  0.000000e+00 0.01  0.000000  0.000000
## [4,]  8.000000e-01  8.000000e-01 0.00  1.610000 -1.580247
## [5,] -8.000000e-01 -8.000000e-01 0.00 -1.580247  1.610000

8.3 Matrix inversion wiki

8.3.1 2 X 2

The cofactor equation listed above yields the following result for 2 ?? 2 matrices. Inversion of these matrices can be done as follows

\[\text{A}^{-1}=\left[ \begin{matrix} a & b\\ c & d \end{matrix} \right] ^{-1} =\frac{1}{det (\text{A})}\left[ \begin{matrix} A & B\\ C & D \end{matrix} \right] =\frac{1}{ad-bc}\left[ \begin{matrix} d & -b\\ -c & a \end{matrix} \right] \] Where the scalar \(A\) is not to be confused with the matrix A.

8.3.2 3 X 3

\[\text{A}^{-1}=\left[ \begin{matrix} a & b & c\\ d & e & f\\ g & h & i \end{matrix} \right] ^{-1} =\frac{1}{det (\text{A})}\left[ \begin{matrix} A & B & C\\ D & E & F\\ G & H & I \end{matrix} \right] ^{T} =\frac{1}{det (\text{A})}\left[ \begin{matrix} A & D & G\\ B & E & H\\ C & F & I \end{matrix} \right] \]

in which \[\begin{matrix} A=(ei-fh), & D=-(bi-ch), & G = -(bf-ce), \\ B=-(di-fg), & E=(ai-cg), & H = -(af-cd), \\ C=(dh-eg), & F=-(ah-bg), & I = (ae-bd). \end{matrix} \]