Here we reiterate the fastGWA model ! = # $%& ' $%& + ) * + * + , + -[S1]where ! is an . × 1 vector of mean centred phenotypes with . being the sample size; # $%& is a vector of mean-centred genotype variables of a variant of interest with its effect ' $%& ; ) * is the incidence matrix of fixed covariates with their corresponding coefficients + * ; , is a vector of the total genetic effects captured by pedigree relatedness with ,~2(0, 67 8 9 ); 6 is the family relatedness matrix based on pedigree structure; -is a vector of residuals with -~2(0, <7 = 9 ). The variance-covariance matrix of ! is > = 67 8 9 + ?7 = 9 and the generalized least squares estimate of. Therefore, to test whether ' $%& = 0, we first need to estimate the variance components 7 8 9 and 7 = 9 . As in most existing MLM-based association tools 1-7 , to avoid running the variance estimation analysis repeatedly for each target variant, we estimate 7 8 9 and 7 = 9 under the null modelassuming the effect of a single variant on 7 N 8 9 is negligible. The REML log-likelihood (L) function of model [2] can be written asConventional REML algorithms such as the average information (AI) 8 involve the computations of > WX , Y and Y6, which is computationally intensive when n is large even if 6 is sparse. Here we describe an algorithm (termed as fastGWA-REML) that uses grid search to estimate 7 8 9 without the need to compute > WX , Y and Y6. For ease of computation, we first adjust the phenotype for covariates by linear regression (let ! Z[\ denote a vector of phenotypes after adjustment). We can rewrite L as −with 1 being an . × 1 vector of 1's. All the elements in L including |>|, > WX X and > WX ! Z[\ can be computed efficiently by the Cholesky decomposition of V (without the need of computing > WX ) in sparse matrix setting. Because the computation of L is extremely fast, we can use a grid search to obtain an estimate of 7 8 9 (note that 7 N = 9 can be computed as 7 N ] 9 − 7 N 8 9 with 7 N ] 9 being the empirical variance of phenotype after adjustment).The rationale underlying this grid-search method is similar to that in Runcie et al. 9 . We compute the log-likelihood scores given a grid of possible values of 7 N 8 9 (e.g., 7 N 8 9 Î[0, 1.67 N ] 9 ] with 100 steps, i.e., a step size of 0.0167 N ] 9 ). Note that we define an upper limit to be large than 7 N ] 9 to accommodate rare scenarios where the estimate of 7 N 8 9 from the fastGWA model can be larger than 7 N ] 9 if the true heritability is large in the presence of substantial common environmental effects. Next, we refine the search in a window around the 7 N 8 9 value that produces the highest log-likelihood score (denoted by 7 N 8(bZG)
9) with a window size of 0.27 N 8(bZG) 9 and 16 steps. For example, if 7 N 8(bZG) 9 = 0.167 N ] 9 , we will refine the search in 7 N 8 9 Î[0.1447 N ] 9 , 0.1767 N ] 9 ] with 16 steps (i.e., a step size of 0.0027 N ] 9 ). We repeat this process iteratively until the difference in 7 N 8 9 with the highest log-likelihood score between two adjacent iterations is smalle...