### Procedure

The

**A** matrix is decomposed according to Famula [

5].

$A={\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.P\right)}^{-1}D{\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.{P}^{\prime}\right)}^{-1},$

(1)

where

**I** is the identity matrix,

**P** is a lower triangular matrix which identifies the parents of each individual in the population. The

**D** matrix is a diagonal matrix with

*d*_{
i
},

*i* th diagonal element of

**D**. Then

${d}_{i}=\{\begin{array}{ll}\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$4$}\right.{F}_{p}-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$4$}\right.{F}_{q}\hfill & \text{ifbothparentsof}i\text{,say}p\text{and}q\text{,areknown,}\hfill \\ \raisebox{1ex}{$3$}\!\left/ \!\raisebox{-1ex}{$4$}\right.-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$4$}\right.{F}_{p}\hfill & \text{ifonlyoneparent,say}p\text{,isknown,}\hfill \\ 1\hfill & \text{ifneitherparentisknown,}\hfill \end{array}$

(2)

where

*F*_{
p
}and

*F*_{
q
}are the inbreeding coefficients of the parents of the

*i* th animal. In (1),

$\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.P\right)$ is the lower triangular matrix, and

$\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.{P}^{\prime}\right)$ is its transpose matrix. From(1), the inverse of the

**A** matrix is as follows:

${A}^{-1}=\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.{P}^{\prime}\right){D}^{-1}\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.P\right).$

(3)

Next, we introduce the

**K** matrix into (1) so that the

**A** matrix includes GIA. Then,

**A** is

$A\approx {\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.P\right)}^{-1}DK{\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.{P}^{\prime}\right)}^{-1}$

(4)

and

${A}^{-1}\approx \left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.{P}^{\prime}\right){K}^{-1}{D}^{-1}\left(I-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.P\right),$

(5)

where

**K** is the matrix where a diagonal element is set to 1 and the off-diagonal element is set to (1 -

*x*) when

*i* th and

*j* th animals are genetically identical and

*x* is a constant near 0;

**K** is as follows:

$K=\left[\begin{array}{ccc}1& 0& \cdots \\ 0& \ddots \\ \vdots & 1& 1-x\\ 1-x& 1\\ \ddots \end{array}\right].$

Generally, for a matrix with GIAs where the diagonal elements are set to 1, and the off-diagonal elements are (1 -

*x*), the inverse matrix for n GIAs is

${\left[\begin{array}{cccc}1& 1-x& 1-x& \cdots \\ 1-x& 1& 1-x& \cdots \\ 1-x& 1-x& 1& \cdots \\ \vdots & \vdots & \vdots & \ddots \end{array}\right]}^{-1}=\left[\begin{array}{cccc}{l}_{n}& {m}_{n}& {m}_{n}& \cdots \\ {m}_{n}& {l}_{n}& {m}_{n}& \cdots \\ {m}_{n}& {m}_{n}& {l}_{n}& \cdots \\ \vdots & \vdots & \vdots & \ddots \end{array}\right],$

where ${l}_{n}=\frac{1+\left(n-2\right)\left(1-x\right)}{x\left\{1+\left(n-1\right)\left(1-x\right)\right\}}$, ${m}_{n}=-\frac{1-x}{x\left\{1+\left(n-1\right)\left(1-x\right)\right\}}$

and ${l}_{n}+\left(n-1\right){m}_{n}=\frac{1}{1+\left(n-1\right)\left(1-x\right)}$.

Thus, **K**^{-1} is calculated, and the diagonal element of **D**^{-1} is $\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.$. Therefore, **A**^{-1} is calculated directly by the product of the matrices without computing the inverse of **A**.

### Algorithm for computation

Provided *d*_{
i
}is calculated by the methods of Quaas [2] and Famula [5], **A**^{-1} is calculated directly by the following steps:

i) If both parents of *i*, say *p* and *q* are known,

and when *i* has no GIA,

add $\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.$ to element (*i*, *i*),

add $-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to elements (*p*, *i*), (*i*, *p*), (*q*, *i*) and (*i*, *q*),

add $\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$4$}\right.\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to elements (*p*, *p*), (*p*, *q*), (*q*, *p*) and (*q*, *q*);

when *i* has n GIAs (*g*_{
ij
}, j = 1, 2, ... n),

add ${l}_{n}\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to element (*i*, *i*),

add $-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.\left\{{l}_{n}+\left(n-1\right){m}_{n}\right\}\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to elements (*p*, *i*), (*i*, *p*), (*q*, *i*) and (*i*, *q*),

add $\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$4$}\right.\left\{{l}_{n}+\left(n-1\right){m}_{n}\right\}\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to elements (*p*, *p*), (*p*, *q*), (*q*, *p*) and (*q*, *q*).

If *i* is a donor animal of the GIAs,

then add ${m}_{n}\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to elements (*i*, *g*_{
ij
}) and (*g*_{
ij
}, *i*).

ii) If only one parent, say p, is known,

add $\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.$ to element (*i*, *i*),

add $-\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$2$}\right.\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to elements (*p*, *i*) and (*i*, *p*),

add $\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$4$}\right.\left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{${d}_{i}$}\right.\right)$ to element (*p*, *p*).

iii) If neither parent is known,

add 1 to element(*i*, *i*).