Abstract
Regions in the genome that affect complex traits, quantitative trait loci (QTL), can be identified using statistical analysis of genetic and phenotypic data. When restricted maximum-likelihood (REML) models are used, the mapping procedure is normally computationally demanding. We develop a new efficient computational scheme for QTL mapping using variance component analysis and the AI-REML algorithm. The algorithm uses an exact or approximative low-rank representation of the identity-by-descent matrix, which combined with the Woodbury formula for matrix inversion results in that the computations in the AI-REML iteration body can be performed more efficiently. For cases where an exact low-rank representation of the IBD matrix is available a-priori, the improved AI-REML algorithm normally runs almost twice as fast compared to the standard version. When an exact low-rank representation is not available, a truncated spectral decomposition is used to determine a low-rank approximation. We show that also in this case, the computational efficiency of the AI-REML scheme can often be significantly improved.
Introduction
Traits that vary continuously are called quantitative. In general, such traits are affected by an interplay between multiple genetic factors and the environment. Most medically and economically important traits in humans, animals and plants are quantitative, and understanding the genetics behind them is of great importance.
Introduction
The dissection of quantitative traits is generally performed by statistical analysis of genetic and phenotypic data for experimental populations. Such analysis can reveal quantitative trait loci, QTL, in the genome that affect the trait. In the field of QTL analysis [8] , the use of variance component models are commonly used, see e.g. [2] . Using such models, the statistical analysis is performed using maximum-likelihood (ML) or restricted maximumlikelihood (REML) estimators which have the advantage that they do not use specific assumptions on the design or balance of the data. These types of schemes are often considered to be statistically efficient since they utilize all available data. On the other hand, the corresponding algorithms are also relatively computationally demanding since non-linear optimization problems must be solved using an iterative procedure. When searching for the most likely locations of the QTL, REML optimization problems must be solved for many genetic locations within an outer global optimization procedure. Furthermore, if the significance of the results is established using an experimental procedure like parametric bootstrap [3] , hundreds or thousands of QTL searches must be performed. This implies that the computational complexity for the numerical methods for solving the REML problems must be minimal for the QTL mapping to be viable.
Introduction
During the last two decades, specialized algorithms for variance component analysis in animal breeding settings have been developed and implemented in codes like ASREML, DMU and VCE, see [4] and references therein. The algorithms used in these codes have in common that they use a specific Newton-type iteration, the average information restricted maximum likelihood algorithm, AI-REML. However, the structure of the problems in traditional animal breeding applications is different from that of QTL analysis problems, and the computational schemes should be examined and possibly modified before they are applied in a QTL analysis setting. In this short paper we perform this type of investigation and develop a new efficient computational scheme for QTL mapping using variance component analysis and the AI-REML algorithm. This type scheme should then be applied within an efficient and robust optimization method for maximizing the likelihood in the AI-REML method, and also within an efficient and robust global optimization algorithm for the search for the outer optimization problem where the most likely position of the QTL is determined.
The AI-REML algorithm
A general linear mixed model is given by
The AI-REML algorithm
where y is a vector of n observations, X is the n × n f design matrix for n f fixed effects, R is the n × n r design matrix for n r random effects, b is the vector of n f unknown fixed effects, r is the vector of n r unknown random effects, and e is a vector of n residuals. In the QTL analysis setting, we assume that the entries of e are identically and independently distributed and there is a single observation for each individual in the pedigree. In this case, the covariance matrices are given by var(e) = Iσ 2 e and var(r) = Aσ 2 a , where A is referred to as the identity-by-descent (IBD) matrix. Using these assumptions, we have that
The AI-REML algorithm
Here, σ 1 ≥ 0 and σ 2 > 0 and we assume that the phenotype follows a normal distribution with y MV N(Xb, V ). At least two different procedures can be used for computing estimates of b and σ 1,2 . In the standard codes mentioned above, the parameters are computed from the mixed-model equations (MME) [8] using a the inverse of A. To be able to use this approach, A has to be positive definite, or it must be modified so that this property holds. Also, the computations can be performed efficiently if A is sparse. For the QTL analysis problems, the IBD matrix A is often only semi-definite and not necessarily sparse. Here the values of σ 1,2 are given by the solution of the minimization problem
The AI-REML algorithm
where L is the log-likelihood for the model (1),
The AI-REML algorithm
and the projection matrix P is defined by
The AI-REML algorithm
In the original AI-REML algorithm, the minimization problem is solved using the standard Newton scheme but where the Hessian is substituted by the average information matrix H AI , whose entries are given by
The AI-REML algorithm
The entries of the gradient of L are given by
Efficient implementation of AI-REML optimization
The main result of this paper is an algorithm that allows for an efficient implementation of the iteration body in the AI-REML algorithm for variance component analysis in QTL mapping problems. In [9] , we examine optimization schemes for the REML optimization and different approaches for introducing the constraints for σ 1,2 in the AI-REML scheme. For cases when the solution to the optimization problem is close to a constraint, different adhoc fixes have earlier been attempted to ensure convergence for the Newton scheme. In [9] , we show that by introducing an active-set formulation in the AI-REML optimization scheme, robustness and good convergence properties were achieved also for cases when the solution is close to a constraint. When computing the results below, we use the active-set AI-REML optimization scheme from [9] . From the formulas in the previous section, it is clear that the most computationally demanding part of the AI-REML algorithm is the computation of the matrix P , and especially the explicit inversion of the matrix V = σ 1 A + σ 2 I, where A is a constant semi-definite matrix and σ 1,2 are updated in each iteration. If V is regarded as a general matrix, i.e. no information about the structure of the problem is used, a standard algorithm based on Cholesky factorization with complete pivoting is the only alternative, and O(n 3 ) arithmetic operations are required. If A is very sparse, the work can be significantly reduced by using a sparse Cholesky factorization, possibly combined with a reordering of the equations. This can be compared to the approach taken e.g. in [1] , where a sparse factorization is used for A when solving the mixed-model equations. However, as remarked earlier A is only semi-definite and not very sparse for the QTL analysis problems and this approach is not an option here.
Efficient implementation of AI-REML optimization
The IBD matrix A is a function of the location in the genome where the REML model is applied. The key observation leading to a more efficient algorithm for inverting V is that the rank of A at a location with complete genetic information only depends on the size of the base generation. At such locations, A will be a rank-k matrix where k ≪ n in experimental pedigrees with small base generations. If the genetic information is not fully complete, A can still be approximated by a low-rank matrix. The error in such an approximation can be made small when the genetic distance to a location with complete data is small.
Efficient implementation of AI-REML optimization
Let a symmetric rank-k representation of A be given by
Efficient implementation of AI-REML optimization
where Z is an n × k matrix. We now exploit this type of representation to compute V −1 . Case 1: An exact low-rank representation of A is available apriori. In general, the inverse of a matrix plus a low-rank update can be computed using the Woodbury formula, see e.g. [6] ,
Efficient implementation of AI-REML optimization
Applying (10) with C = Iσ 2 , S 1 = Z and S 2 = σ 1 Z, we get the following formula for computing V −1 ,
Efficient implementation of AI-REML optimization
where σ = σ 1 σ −1 2 . The k × k matrix Z T Z can be computed once, before the Newton iteration is started. Also, the matrix (I + σZ T Z) is only of size k ×k, and its inverse can be computed using a standard factorization method in O(k 3 ) arithmetic operations.
Efficient implementation of AI-REML optimization
Case 2: No low-rank representation of A is given a-priori. If only the matrix A is given, a low-rank representation/approximation can be computed once before the Newton iteration is started. Then, the Woodbury formula is again used to get an efficient computational algorithm for the iterations. Computing a low-rank approximation of a matrix is a problem with a long history [5] , and the standard tool is the truncated singular value decomposition, see e.g. [6, 10] , which computes the optimal approximation in Frobenius norm. In our case, A is symmetric and positive semi-definite, and the SVD is equivalent to the standard spectral decomposition. Also, the spectral decomposition can be written as
Efficient implementation of AI-REML optimization
Hence, we compute a low-rank representation of A using a truncated spectral decomposition,
Efficient implementation of AI-REML optimization
where Λ t is a diagonal matrix of k eigenvalues and W t is a rectangular matrix of size n × k containing the corresponding orthogonal eigenvectors. Here, Λ t and W t are obtained by eliminating the n − k smallest eigenvalues and the corresponding eigenvectors from the standard spectral decomposition. Again using the Woodbury formula (10),
Efficient implementation of AI-REML optimization
A similar approach for matrix inversion has been used for problems in Gaussian process regression with applications in e.g. machine learning, see [13, 11] . However, as far as we know, an approach based on a truncated spectral decomposition and formula (13) has not been been pursued for Newton iterations for REML-problems before. When performing the computation described by (13), the matrix W t √ Λ t is constant and can be precomputed before the iteration starts. The matrix (I + σΛ t ) is diagonal, so its inverse is trivially computable.
Efficient implementation of AI-REML optimization
The factorization (12) is a rank-k representation of A. This is exact if A has at least n − k zero eigenvalues, and thenṼ −1 = V −1 . For a general IBD matrix A, more than k eigenvalues will normally be non-zero, resulting in thatṼ −1 is an approximation of V −1 . The accuracy of this approximation depends on the quality of the truncated factorization (12) for A. For the QTL analysis problems, we need to chose the rank k such that the accuracy of the solution to the REML problem, i.e. the variance components σ 1,2 , is sufficient.
Efficient implementation of AI-REML optimization
Assume that the eigenvalues are ordered such that λ 1 ≥ λ 2 ≥ · · · ≥ λ n . Several criteria for choosing k can be considered. One option is to simply set k to a predetermined value, either motivated by the known value of the rank at a fully informative position in the genome or determined as a given percentage of n. Such a choice has the advantage that it is possible to predetermine the computational work needed for computation ofṼ −1 in (13). Another easily applied criterion for determining k is given by
Efficient implementation of AI-REML optimization
where the threshold τ is for example chosen as τ = 0.001. This means that all eigenvalues of the matrix A that are smaller than 0.001λ 1 are neglected and the corresponding columns of W in the spectral decomposition are deleted.
Efficient implementation of AI-REML optimization
In the numerical experiments presented in the next section, we use the truncation criterion (14). For computing the truncated spectral decomposition, we currently use a standard eigenvalue solver, compute all eigenvalues and eigenvectors, and then ignore the data connected to eigenvalues smaller than given by the truncation criterion. For problems with large data matrices where it is known that only a small number of eigenvalues will be large, an alternative can be to use e.g. the Lanczos iteration for computing these. Potentially, this can reduce the arithmetic work for computing the truncated decomposition before the iteration starts.
Efficient implementation of AI-REML optimization
Once V −1 has been computed using either (13) or (11), formula (6) is used to compute P , and the entries of the Hessian H AI and the gradient of L are computed using the formulas (7) and (8) . The matrices involved have common terms which are computed once at the beginning of the current iteration to reduce the total complexity.
Numerical Results
In this section we present numerical experiment computed using experimental IBD matrices of size 767 × 767 drawn from a chicken population [7] . For these first pilot investigations of the computational performance we have chosen to implement the algorithms in Matlab, and we present execution time measurements for the Matlab scripts. At a later stage, we will implement the most promising algorithms also in C, which will reduce the execution time further. In this case, we expect that the relative gain from using the new algorithms will be larger than indicated below. Matlab's native implementation of standard inversion is presumably more efficient than our Matlab scripts for the new algorithms, which are leslieaustin@example.org.
Numerical Results
Case 1: We first present numerical results for the case when the IBD matrices A have exact low-rank representations given a-priori. Let T C be the measured computational time for the computation of V −1 within the AI-REML scheme using standard inversion, and let T W be the corresponding time when using the low-rank representation and formula (11) . In Figure 1 we show T C /T W , i.e. the speedup for the computations of V −1 , as a function of the rank k of the matrices A. Figure 1 , it is clear that for IBD matrices of size 767 × 767, the implementation using the low-rank representation is faster if the rank k is smaller than approximately 350. Also, for k < 50, the speedup is more than one order of magnitude.
Numerical Results
In Table 1 we present the total CPU-times for the AI-REML scheme and the CPU-time for the computations of V −1 within this scheme for different values of k and number of iterations equal to 9. The total CPU-times for the AI-REML are denoted by T tot C and T tot W , while the CPU-times for the computation of V −1 are denoted by T C and T W . Table 1 : Total CPU-time for the AI-REML computations and CPU-time for computing V −1 for the schemes using standard inversion and a low-rank representation From Table 1 it is clear that for the problems studied here, computing V −1 using standard inversion accounts for approximately half of the computational time in the AI-REML scheme. For small values of k, the time needed for inverting V −1 using the low-rank representation can effectively be ignored, and the improved algorithm runs approximately twice as fast as the original scheme using standard inversion.
Numerical Results
Case 2: We now turn to case 2. Here a low-rank representation of A is not available a-priori, and a truncated eigenvalue decomposition must be computed before the AI-REML iteration starts. We present results from computations performed using 18 different IBD matrices corresponding to genetic locations where a low-rank representation is not given. The first set of results shows the computational time T C,T W for computing V −1 within the AI-REML scheme. In this case we compare standard inversion (C) to the scheme given by (13) , based on truncated spectral decomposition (TW).
Numerical Results
In Table 4 , we show the CPU-time and the number of AI-REML iterations for the two schemes. For the scheme based on the truncated spectral decomposition, the table also shows the rank k as determined by the truncation criterion (14) and the relative errors (in %) for the variance components (e σ 1,2 ) arising from using a low-rank approximation of A. Table 2 : CPU-time for computing V −1 within the AI-REML iteration, and errors arising from exploiting a low-rank approximation of A For the matrices A 11 and A 12 , the variance component σ 1 is zero, and it is not possible to compute the relative error. For these matrices, the absolute errors in σ 1 is very small for both values of τ . From the results in Table  4 , it is clear that the accuracy of the variance components does not only depend on the value of the parameter τ , but also on the properties of the matrix A. When an approximation of V −1 is employed in the computations, the optimization landscape is affected in different ways for different IBD matrices A, resulting in different behavior for the optimization scheme and different errors in the location of the optima. However, for the problems studied here, choosing τ = 0.001 results in that the variance components are determined with sufficient accuracy for all the IBD matrices examined.
Numerical Results
In the next set of experiments we study the speedup and error introduced by using an approximate inverse of V in some more detail for the two IBD matrices A 1 and A 13 . As can be seen from Table 1 , A 1 is harder to approximate with a low rank matrix than A 13 . In Tables 4 and 4 , we vary the value of the parameter τ in the truncation criterion (14) and show the resulting rank k of the approximation of A, the number of iterations in the AI-REML optimization scheme, the speedup T C /T T W , and the relative errors in the variance components. From Figure 2 , we see that the standard scheme using direct inversion is faster when number of iterations is small, i.e. less than 9 iterations. The reason for this is that the spectral decomposition of the matrix A is relatively costly, and it must be amortized over a number of iterations before the faster iterations begin to pay of. When the number of iterations required is significantly larger than 9, which is often the case for real-world problems, the new algorithm is significantly faster also when no low-rank representations of the IBD matrices are not available a priori.
Conclusions
In this paper we present a family of algorithms that allow for an efficient implementation of the iteration body in the AI-REML algorithm for variance component analysis in QTL mapping problems. Combined with the improved optimization scheme in [9] , the new algorithms form a basis for an efficient and robust AI-REML scheme for evaluating variance component QTL models.
Conclusions
The most costly operation in the AI-REML iteration body is the explicit inversion of the matrix V = σ 1 A + σ 2 I, where the IBD matrix A is constant and positive semi-definite, and σ 1 ≥ 0 and σ 2 > 0 are updated in each iteration. The key information enabling the introduction of improved algorithms is that the rank of A at a location in the genome with complete genetic information only depends on the size of the base generation. At such locations, A will be a rank-k matrix where k ≪ n, and by exploiting the Woodbury formula the inverse of V can be computed more efficiently than by using a standard algorithm based on Cholesky factorization. If the genetic information is not fully complete, a general IBD matrix A can still be approximated by a low-rank matrix and the error in such an approximation can be made small when the genetic distance to a location with complete data is small. More importantly, there might be a possibility for setting up a low-rank representation of the matrix A also at genetic locations where the information is not complete. This is a topic of current investigation [12] .
Conclusions
We present results for IBD matrices A from a real data set for two different settings; Firstly, we show that if a low-rank representation of A is available a-priori, the inversion of V using the new algorithms is performed faster than using a standard algorithm if the rank k is smaller than approximately 350. Also, for k < 50, the speedup is more than one order of magnitude.
Conclusions
Then we also show that, even if a low-rank representation is not directly available and a low-rank approximation of A needs to be computed before the AI-REML iterations, significant speedup of the variance component model computations can still be achieved. For QTL mapping problems, the efficiency of our new method will increase when the ratio between the total pedigree size and base generation size increases, the density and informativeness of markers increases. Hence, the relative efficacy of the method will continuously increase in the future with deeper pedigrees and more markers. Also, we are currently developing a scheme for directly constructing a lowrank representation of the IBD matrix A also between markers, which will result in that the eigenvalue factorization prior to the AI-REML iterations is not needed any more.

{'paper_id': '13936044', 'title': 'Efficient implementation of the AI-REML iteration for variance component QTL analysis', 's2_url': 'https://api.semanticscholar.org/CorpusID:13936044', 'source': 'S2ORC'}