H.inverse {ASRgenomics}R Documentation

Generates the inverse of the hybrid H matrix


The single-step GBLUP approach combines the information from the pedigree relationship matrix \boldsymbol{A} and the genomic relationship matrix \boldsymbol{G} in one hybrid relationship matrix called \boldsymbol{H}. This function will calculate directly the inverse of this matrix \boldsymbol{H}. The user should provide the matrices \boldsymbol{A} or its inverse (only one of these is required) and the inverse of the matrix \boldsymbol{G} (\boldsymbol{G_{inv}}) in its full form. Individual names should be assigned to rownames and colnames, and individuals from \boldsymbol{G_{inv}} are verified to be all a subset within individuals from \boldsymbol{A} (or \boldsymbol{A_{inv}}).


  A = NULL,
  Ainv = NULL,
  Ginv = NULL,
  lambda = NULL,
  tau = 1,
  omega = 1,
  sparseform = FALSE,
  keep.order = TRUE,
  digits = 8,
  inverse = TRUE,
  message = TRUE



Input of the pedigree relationship matrix \boldsymbol{A} in full form (na \times na) (default = NULL).


Input of the inverse of the pedigree relationship matrix \boldsymbol{A}^{-1} in full form (na \times na) (default = NULL).


Input of the inverse of the genomic relationship matrix \boldsymbol{G}^{-1} in full form (ng \times ng) (default = NULL).


The scaling factor for (\boldsymbol{G}^{-1}-\boldsymbol{A}^{-1}_{22}) (default = NULL).


The scaling factor for \boldsymbol{G}^{-1} (default = 1).


The scaling factor for \boldsymbol{A}^{-1}_{22} (default = 1).


If TRUE it generates the requested matrix in sparse form to be used directly in asreml with required attributes (default = FALSE).


If TRUE the original order of the individuals from the \boldsymbol{A} or \boldsymbol{A_{inv}} matrix is kept. Otherwise the non-genotyped individuals are placed first and then genotyped individuals (default = TRUE).


Set up the number of digits used to round the output matrix (default = 8).


If TRUE it generates the inverse of \boldsymbol{H} matrix (default = TRUE) (to be deprecated).


If TRUE diagnostic messages are printed on screen (default = TRUE).


The generation of the \boldsymbol{H^{-1}} matrix contains a few scaling factors to help with the calculation of this inverse and to allow further exploration of the combination of the information from the \boldsymbol{A^{-1}} and \boldsymbol{G^{-1}}. We follow the specifications described by Martini et. al (2018), which is done by specifying the parameters \lambda, or the pair \tau and \omega.

The general expression used is:


and a more common representation of the above expression is found when \tau = \omega = \lambda, as shown below:


If inverse = FALSE the \boldsymbol{H} matrix is provided instead of its inverse. This option will be deprecated and it is better to use the function H.matrix.

The \boldsymbol{H} matrix is obtained with the following equations:



The inverse of the hybrid matrix \boldsymbol{H} matrix, in full or sparse form with required attributes to be used in asreml.


Christensen, O.F., Lund, M.S. 2010. Genomic prediction matrix when some animals are not genotyped. Gen. Sel. Evol. 42(2):1–8.

Christensen, O., Madsen, P., Nielsen, B., Ostersen, T., and Su, G. 2012. Single-step methods for genomic evaluation in pigs. Animal 6(10):1565–1571.

Legarra, A., Aguilar, I., and Misztal, I. 2009. A relationship matrix including full pedigree and genomic information. J. Dairy Sci. 92:4656-4663.

Martini, J.W.R., Schrauf, M.F., Garcia-Baccino, C.A., Pimentel, E.C.G., Munilla, S., Rogberg-Muñoz, A., Cantet, R.J.C., Reimer, C., Gao, N., Wimmer, V., and Simianer, H. 2018. The effect of the H^{-1} scaling factors \tau and \omega on the structure of H in the single-step procedure. Genet. Sel. Evol. 50:1-9.


# Get A matrix.
A <- AGHmatrix::Amatrix(data = ped.pine)

# Read and filter genotypic data.
M.clean <- qc.filtering(
 M = geno.pine655,
 maf = 0.05,
 marker.callrate = 0.2, ind.callrate = 0.20,
 na.string = "-9",
 plots = FALSE)$M.clean

# Get G matrix.
G <- G.matrix(M.clean, method = "VanRaden", na.string = "-9")$G
G[1:5, 1:5]

# Match G and A.
check <- match.G2A(
 A = A, G = G,
 clean = TRUE, ord = TRUE, mism = TRUE, RMdiff = TRUE)

# Align G matrix with A.
G_align <- G.tuneup(G = check$Gclean, A = check$Aclean, align = TRUE, sparseform = FALSE)$Gb

# Get Ginverse using the G aligned.
Ginv <- G.inverse(G = G_align, sparseform = FALSE)$Ginv
Ginv[1:5, 1:5]

# Obtain Hinv.
Hinv <- H.inverse(A = A, Ginv = Ginv, lambda = 0.90, sparseform = TRUE)
attr(Hinv, "INVERSE")

[Package ASRgenomics version 1.1.3 Index]