# Coordinate Descent for Variance-Component Models
## Appendix A QR Method  
In this section, we provide further details on the QR factorization used in Section 3.3.1. Recall that we have the decomposition,  
\[\mathbf{Z}=\widehat{ \begin{bmatrix}\mathbf{Q}_{[c]}&\mathbf{Q}_{[n-c]}\end{bmatrix}  } \begin{bmatrix}\mathbf{R}\\ \mathbf{Q}\end{bmatrix} ,\quad\mathbf{R}= \begin{bmatrix}|&|&|\\ \mathbf{R}_{1}&\mathbf{R}_{2}&\cdots&\mathbf{R}_{m}\\ |&|&|&|\end{bmatrix} ,\]  
where \(\mathbf{Q}\) is an orthogonal matrix and \(\mathbf{R}\) is partitioned such that the number of columns in \(\mathbf{R}_{i}\) is equal to number of columns in \(\mathbf{Z}_{i}\). Recall that \(\widetilde{\boldsymbol{y}}=[\widetilde{\boldsymbol{y}}_{[c]},\,\widetilde{ \boldsymbol{y}}_{[n-c]}]^{\top}=\mathbf{Q}^{\top}\boldsymbol{y}\) where \(\widetilde{\boldsymbol{y}}_{[c]}\) are the first \(c\) elements of \(\widetilde{\boldsymbol{y}}\) and \(\widetilde{\boldsymbol{y}}_{[n-c]}\) are the last \(n-c\) elements of \(\widetilde{\boldsymbol{y}}\). Then,  
\[\mathbf{\Omega} =\boldsymbol{\gamma}_{0}\mathbf{I}+\mathbf{Z}\mathbf{\Sigma} \mathbf{Z}^{\top}\] \[=\mathbf{Q}\bigg{(}\gamma_{0}\mathbf{I}+ \begin{bmatrix}\mathbf{R }\\ \mathbf{0}\end{bmatrix} \mathbf{\Sigma} \begin{bmatrix}\mathbf{R}^{\top}& \mathbf{0}\end{bmatrix} \bigg{)}\mathbf{Q}^{\top}\] \[=\mathbf{Q} \begin{bmatrix}\mathbf{R}^{\mathbf{\Sigma}\mathbf{R} ^{\top}}+\gamma_{0}\mathbf{I}_{c}&\mathbf{0}\\ \mathbf{0}&\gamma_{0}\mathbf{I}_{n-c}\end{bmatrix} \mathbf{Q}^{\top}.\]  
Taking the inverse of this matrix yields  
\[\mathbf{\Omega}^{-1}=\mathbf{Q} \begin{bmatrix}\begin{pmatrix}\mathbf{R} \mathbf{\Sigma}\mathbf{R}^{\top}+\gamma_{0}\mathbf{I}_{c}\end{pmatrix}^{-1}& \mathbf{0}\\ \mathbf{0}&\gamma_{0}^{-1}\mathbf{I}_{n-c}\end{bmatrix} \mathbf{Q}^{\top}.\]  
and  
\[\boldsymbol{y}^{\top}\mathbf{\Omega}^{-1}\boldsymbol{y}=\widetilde{\boldsymbol {y}}_{[c]}^{\top}\widetilde{\mathbf{\Omega}}^{-1}\widetilde{\boldsymbol{y}}_{[ c]}+\gamma_{0}^{-1}\widetilde{\boldsymbol{y}}_{[n-c]}^{\top}\widetilde{ \boldsymbol{y}}_{[n-c]}. \tag{1}\]  
We now consider the simplifications for the trace terms in \(H\). Let  
\[\widetilde{\mathbf{\Sigma}}=\mathbf{block}\;\mathbf{diag}(\widetilde{\gamma}_ {1}\mathbf{I}_{c_{1}},\ldots,\widetilde{\gamma}_{m}\mathbf{I}_{c_{m}}).\]  
Then, \(\mathbf{C}=\widetilde{\gamma}_{0}\mathbf{I}+\mathbf{Z}\widetilde{\mathbf{ \Sigma}}\mathbf{Z}^{\top}\) and  
\[\mathbf{C}^{-1}=\mathbf{Q} \begin{bmatrix}\begin{pmatrix}\mathbf{R} \widetilde{\mathbf{\Sigma}}\mathbf{R}^{\top}+\widetilde{\gamma}_{0}\mathbf{I }_{c}\end{pmatrix}^{-1}&\mathbf{0}\\ \mathbf{0}&\widetilde{\gamma}_{0}^{-1}\mathbf{I}_{n-c}\end{bmatrix} \mathbf{Q} ^{\top}.\]If we substitute this expression into the trace term when \(k\
eq 0\), we obtain  
\[\text{tr}\Big{(}\mathbf{C}^{-1}\mathbf{V}_{k}\Big{)} =\text{tr}\Big{(}\mathbf{Z}_{k}^{\top}\mathbf{C}^{-1}\mathbf{Z}_{k} \Big{)}\] \[=\text{tr}\Bigg{(}\mathbf{Z}_{k}^{\top}\mathbf{Q}\Bigg{[} \begin{pmatrix} \mathbf{R}\widetilde{\Sigma}\mathbf{R}^{\top}+\widetilde{\gamma}_{0}\mathbf{I }_{c}\end{pmatrix} ^{-1}&\mathbf{0}\\ \mathbf{0}&\widetilde{\gamma}_{0}^{-1}\mathbf{I}_{n-c}\Bigg{]}\mathbf{Q}^{\top }\mathbf{Z}_{k}\Bigg{)}\] \[=\text{tr}\Bigg{(} \begin{bmatrix}\mathbf{R}_{k}^{\top}&\mathbf{0} \end{bmatrix} \Bigg{[} \begin{pmatrix}\mathbf{R}\widetilde{\Sigma}\mathbf{R}^{ \top}+\widetilde{\gamma}_{0}\mathbf{I}_{c}\end{pmatrix} ^{-1}&\mathbf{0}\\ \mathbf{0}&\widetilde{\gamma}_{0}^{-1}\mathbf{I}_{n-c}\Bigg{]} \begin{bmatrix} \mathbf{R}_{k}\\ \mathbf{0}\end{bmatrix} \Bigg{)}\] \[=\text{tr}\bigg{(} \begin{pmatrix}\mathbf{R}\widetilde{\Sigma} \mathbf{R}^{\top}+\widetilde{\gamma}_{0}\mathbf{I}_{c}\end{pmatrix} ^{-1} \mathbf{R}_{k}\mathbf{R}_{k}^{\top}\bigg{)}. \tag{10}\]  
When \(k=0\), we have  
\[\text{tr}\Big{(}\mathbf{C}^{-1}\mathbf{V}_{0}\Big{)} =\text{tr}\Bigg{(}\mathbf{Q}\Bigg{[} \begin{pmatrix}\mathbf{R} \widetilde{\Sigma}\mathbf{R}^{\top}+\widetilde{\gamma}_{0}\mathbf{I}_{c} \end{pmatrix} ^{-1}&\mathbf{0}\\ \mathbf{0}&\widetilde{\gamma}_{0}^{-1}\mathbf{I}_{n-c}\Bigg{]}\mathbf{Q}^{\top} \Bigg{)}\] \[=\text{tr}\Bigg{(}