As outlined in the previous genomic-based algorithm sections (i.e. Recursive Method to Create G Inverse),
when utilizing a relationship matrix in the mixed model equations, the inverse of the relationship matrix is needed (i.e. G-1 instead of the
actual relationship (G). When genomic information was initially utilized in genetic evaluations, the number of animals was small and as a result generating
G-1 was not a huge issue, although as the number of genotyped animals continued to increase computational issues started to manifest. Furthermore,
the sparseness of A-1 and how you could restart from where you left off previously as new animals are generated was an attractive feature
that the majority of programs exploited. As outlined in the previous section describing how to generate different G matrices),
the G matrix is dense with all elements being nonzero. Therefore, the current methods updates G-1 for new individuals instead of
recomputing the entire matrix again. Outlined below is a function that takes in as input a genomic relationship matrix and the algorithm is outlined
in Meyer et al. (2013).
UpdateGinverse <- function(G,GI = matrix(0,0,0),Linv = matrix(0,0,0))
{
## No previous G Inverse Provided start from beginning ##
if (nrow(GI) == 0 & nrow(Linv) == 0)
{
n <- ncol(G)
## Generate cholesky of G ##
L <- t(chol(G))
## Take the inverse of L ##
Linv <- solve(L)
## Generate G inverse ##
GI <- t(Linv) %*% Linv
OldGI <- GI;
OldLinv <- Linv;
rm(GI,Linv,n,L)
return(list("Ginv" = OldGI, "Linv" = OldLinv))
}
## Previous G Inverse Provided start, just update G inverse ##
if(nrow(GI) != 0 & nrow(Linv) != 0)
{
n <- ncol(G); oldn <- ncol(GI)
## Step 1 ##
L21 <- G[(oldn+1):n,1:oldn] %*% t(Linv)
G22_1 <- G[(oldn+1):n,(oldn+1):n] - L21 %*% t(L21)
L22 <- t(chol(G22_1)); rm(G22_1)
## Step 2 ##
L22inv <- solve(L22)
L21inv <- -1 * (L22inv %*% L21 %*% Linv)
## Step 3 ##
G11inv <- GI + t(L21inv)%*%L21inv
G21inv <- (t(L22inv)) %*% L21inv
G22inv <- t(L22inv) %*% L22inv
## Combine all Matrices ##
Ginv <- rbind(cbind(G11inv,t(G21inv)),cbind(G21inv,G22inv))
Linv <- rbind(cbind(Linv,matrix(0,oldn,(n-oldn))),cbind(L21inv,L22inv))
OldGI <- Ginv;
OldLinv <- Linv;
rm(Ginv,Linv,G11inv,G21inv,G22inv,L21,L21inv,L22,L22inv,n,oldn)
return(list("Ginv" = OldGI, "Linv" = OldLinv))
}
}
- Henderson, C. R. 1976. A simple method for computing the inverse of a numerator relationship matrix used in prediction of
breeding values. Biometrics 32:69-83.
- Meyer, K. B. Tier, and H.-U. Graser. 2013. Technical Note: updating the inverse of the genomic relationship matrix. J. Anim. Sci. 91:2583-2586.
- Misztal, I., A. Legarra and I. Aguilar. 2014. Using recursion to compute the inverse of the genomic relationship matrix J. Dairy Sci. 97:3943–3952.