Bayes factor for linear mixed model in genetic association studies

Yongtao Guan , Daniel Levy

Quant. Biol. ›› 2026, Vol. 14 ›› Issue (2) : e70036

PDF (358KB)
Quant. Biol. ›› 2026, Vol. 14 ›› Issue (2) :e70036 DOI: 10.1002/qub2.70036
TECHNICAL NOTE
Bayes factor for linear mixed model in genetic association studies
Author information +
History +
PDF (358KB)

Abstract

Bayes factor has advantages over p‐value as test statistics for association, particularly when comparing multiple non‐nested alternative models. An efficient method to compute Bayes factor for linear mixed model (LMM) in the context of genetic association studies is lacking. In this study, we transform the standard LMM to a Bayesian linear regression by substituting the random effect with fixed effects, where the covariates of the fixed effects are eigenvectors of the genetic relatedness matrix and their respective prior effect sizes are proportional to the corresponding eigenvalues. Using conjugate normal inverse gamma priors on regression parameters, Bayes factors can be computed in a closed form. We demonstrate numerically the known relationship between Bayes factors and p‐values for the LMM. We then show that predictions based on the transformed Bayesian linear regression are identical to those of the best linear unbiased prediction (BLUP) of the standard LMM. Our results provided a new perspective and derivation to a known connection between BLUP and Bayesian estimates. Methods described in this note are implemented in the software IDUL as two new functionalities: computing Bayes factors and residuals for the LMM.

Graphical abstract

Keywords

Bayes factor / BLUP / genetic association studies / IDUL / linear mixed model

Cite this article

Download citation ▾
Yongtao Guan, Daniel Levy. Bayes factor for linear mixed model in genetic association studies. Quant. Biol., 2026, 14 (2) : e70036 DOI:10.1002/qub2.70036

登录浏览全文

4963

注册一个新账户 忘记密码

1 INTRODUCTION

The linear mixed model (LMM) has emerged as an effective tool in controlling for population structure and relatedness in a study sample to reduce false positives in genetic association studies [1]. Consider a standard LMM in genetic association literature

(1)y=Wa+xβ+Zu+eu∼MVNn0,τ−1ηKe∼MVNn0,τ−1In,

where W contains conventional covariates such as age and sex, including a column of 1; x contains genetic variant(s) to be tested for association; and u is the random effect with Z as its loading matrix and K, whose (i,j)‐th entry is twice the kinship between samples i and j, as its covariance matrix (both Z and K are known). MVNn denotes an n‐dimensional multivariate normal distribution, In is n‐dimensional identity matrix. In genetic association studies, the random effect Zu is a nuisance term that absorbs part of the phenotype y that is attributable to population stratification and relatedness. Here η is a hyperparameter, measuring the ratio between two dispersion terms (random effect u and random noise e).

In classical literature, η is known [2]. In Genome‐Wide Association Study applications, however, η is an important parameter to be estimated, either using maximum likelihood (ML) or restricted maximum likelihood (REML) approaches [3]. Conditioning on η, estimates of aˆ and βˆ can be obtained and either the likelihood ratio test or Wald test can be used to compute a p‐value to test against the following null model

(2)y=Wa+Zu+eu∼MVNn0,τ−1ηKe∼MVNn0,τ−1In,

where the hyperparameter η was estimated from the alternative Model (1). IDUL algorithm is an efficient and asymptotically exact algorithm to estimate η [3], and IDUL software can compute likelihood ratio test p‐value using ML estimate of η or Wald test p‐value using REML estimate of η.

Bayes factors have advantages over p‐values, particularly for comparing multiple non‐nested alternative models [4]. An efficient method to compute Bayes factors for LMM in the context of genetic association studies is missing. Our main objective here is to develop an efficient method to evaluate Bayes factors for the LMM. In order to do that, we first transform the LMM Model (1) to a Bayesian linear regression with a specific prior, then use standard normal inverse gamma priors on regression parameters to express Bayes factors in a closed form, which can be evaluated efficiently. The transformed Bayesian linear regression can be used for prediction, and we show that the Bayesian prediction is identical to that of best linear unbiased prediction (BLUP) [5].

2 RESULTS

2.1 Bayesian linear regression

With reference to Model (1), the genetic relatedness matrix can be computed as G=ZKZt. Let the eigen decomposition of G as G=QDQt, where D=diagd1,…,dn with d1≥d2≥,…,≥dn and QQt=In. Model (1) can be rewritten as

(3)y=Wa+xβ+Qb+eb∼MVNn0,τ−1ηDe∼MVNn0,τ−1In,

where the prior on b has been specified. Model (3) is equivalent to Model (1). To see this, EZuutZt=ηZKZt=ηG=ηQDQt=EQγγtQt. Similarly, Model (2) can be rewritten as

(4)y=Wa+Qb+eb∼MVNn0,τ−1ηDe∼MVNn0,τ−1In.

Note the priors on b are the same between the null and the alternative models. The hyperparameter η can be estimated and plugged in. Its ML estimate can be efficiently computed [3].

2.2 Priors and Bayes factors

Let X=(Q,W). By specifying a Gamma prior on τ, we have the standard normal‐inverse‐gamma on a linear model [6,7].

(5)a∼MVN0,τ−1V0β∼N0,τ−1σ2τ∼Γκ1/2,κ2/2.

For Model (4), after integrating out a,b and τ and letting κ1,κ2→0, we have

(6)py|M0=(2π)−n/2Γ(n/2)|XtX+VX−1|1/2·|VX|1/2·yty−ytXXtX+VX−1−1Xty2−n/2,

where VX=diagηˆD,V0. Similarly, for Model (3), we have

(7)py|M1=(2π)−n/2Γ(n/2)|(X,x)t(X,x)+V(X,x)−1|1/2·|V(X,x)|1/2·yty−yt(X,x)(X,x)t(X,x)+V(X,x)−1−1(X,x)ty2−n/2,

where V(X,x)=diagηˆD,V0,σ2. The Bayes factor py|M1/py|M0, after letting V0−1→0, is

(8)BF(σ)=XtX+VX−11/2(X,x)t(X,x)+V(X,x)−11/21σ·yty−yt(X,x)(X,x)t(X,x)+V(X,x)−1−1(X,x)tyyty−ytXXtX+VX−1−1Xty−n/2.

Note that, by letting V0−1→0, we used improper priors, but both the posterior and Bayes factors are proper [6]. The Bayes factor can be evaluated efficiently (Section 4).

In practice, we need to specify σ to compute Bayes factors. Following prior works [6], we used σ=0.5. With this choice, the prior N0,σ2 puts a probability of 0.34 for effect size to be in interval (−0.5,0.5), a probability of 0.63 for effect size to be in interval (−1,1), and a probability of 0.93 for effect size to be in interval (−2,2). One can also learn prior effect sizes from a histogram estimates of past study and use it as prior for the current study.

2.3 Numerical examples

Figure 1 shows comparisons between Bayes factors computed using Equation (8) and p‐values from the likelihood ratio test calculated using IDUL software [3], stratified according to minor allele frequencies (MAF) of the SNPs. The data, consisting 5757 whole genome sequenced samples with high level of relatedness and 79 protein assay phenotypes, were described previously [8]. We make the following observations: (1) In general, large Bayes factors correspond to small p‐values. (2) Different Bayes factors might have the same p‐values, and different p‐values might have the same Bayes factors. (3) The left panel shows that, for SNPs with the same p‐values, those having larger MAF tend to have larger Bayes factors than those having smaller MAF. This is because Bayes factors penalize SNPs of small MAF for their lower information contents through the prior effect size [9]. (4) Previously, it has been demonstrated that asymptotically 2logeBF=λχ2+loge(1−λ), where λ∈(0,1) increases with the SNP MAF and is also a function of prior effect size [7]. The right panel reflects the mathematical insight between Bayes factors and their corresponding χ2‐values.

2.4 Bayesian prediction and BLUP

From Model (4) we estimate parameters of aˆ and bˆ by XtX+VX−1−1Xty (Section 4). Note both are column vectors. For a new sample, we have a row vector w for covariates and a row vector g for genetic relatedness between the new sample with n existing samples. Then the Bayesian prediction for the new sample is

(9)yˆ=waˆ+qbˆ,

where q=gG−1Q is the least square prediction (based on genetic relatedness) of the new sample onto Q (Section 4). For an existing sample j, q is the j‐th row of the matrix Q.

We now show that the BLUP is identical to Bayesian prediction. From the frequentist point of view, u is a random vector instead of a fixed parameter, it can only be predicted instead of estimated. The Bayesian interpretation of BLUP is well known [5]. Here we offer a new derivation that is perhaps more natural from the perspective of genetic association studies. For BLUP one first estimates a˜=WtH−1W−1WtH−1y, where H=ηˆG+In, and then estimate u˜=ηˆZKZtH−1y−Wa˜. Note both are column vectors. Thus for the new sample, BLUP prediction is

(10)y˜=wa˜+zu˜,

where z=gG−1Z is the least square prediction (based on genetic relatedness) of the new sample onto Z (Section 4). For an existing sample j, z is the j‐th row of the matrix Z.

To show Bayesian prediction yˆ in Equation (9) is identical to BLUP y˜ in Equation (10), it is sufficient to show that aˆ=a˜ and Qbˆ=Zu˜, which we defer to Section 4. Therefore, BLUP is identical to Bayesian prediction under a specific prior. For the existing samples, we can compute residuals using either Bayesian estimates or BLUP as following:

(11)r=y−Waˆ−Qbˆr=H−1y−Waˆ.

Residuals are useful in removing spurious correlations due to population structure and (cryptic) relatedness for subsequent analysis, such as studying gene‐gene interaction and gene networks using gene expression values.

3 DISCUSSION

It is a common practice to control for top principal components (PCs, the columns of the Q matrix) in genetic association study to control for population stratification. It is self‐evident that if a putative causal SNP is correlated with both phenotype and top PCs, this practice of controlling for top PCs will reduce power. Our derivation suggests that when controlling for top PCs, one should put prior on their effect sizes ηˆD∗, where D∗ is a submatrix of D corresponding to the top PCs. Intuitively, the prior will keep some variations of PCs in the phenotypes for the putative causal SNPs, and a priori, the eigenvalues are the right amount of variation to be controlled for.

In classical literature dealing with LMM [2,5], the covariance structure of the error term is a more general R instead of our diagonal In. We can left multiplying R−12 (where R− is a generalized inverse) to convert the classical form to the form in Model (1). In fact, we can rotate the system further and compute the (empirical) Bayes factor based on a rotated simple linear regression. Multiplying both side of Model (4) by Qt we get yQ∼MVNWQ,ηˆD+In, where yQ=Qty and WQ=QtW. Let Λ=ηD+In and scale yQ and WQ by left multiplying Λ−12, we get

(12)yΛ=WΛ·a+ee∼MVNn0,τ−1In,

where yΛ=Λ−12Qty and WΛ=Λ−12QtW. Similarly Model (3) becomes

(13)yΛ=WΛ·a+xΛ·β+ee∼MVNn0,τ−1In,

where xΛ=Λ−12Qtx. Then using priors specified in Equation (5), we can compute Bayes factors [6]. This rotation approach was briefly mentioned by Wen [10]. Bayes factors from this approach is equivalent to Equation (8), but this approach obscures insights on Bayesian prediction and its equivalence to BLUP.

We took an empirical Bayesian approach and plugged in ML estimate of the hyperparameter ηˆ. Of course, we can take the full Bayesian approach by coming up with a prior for η. One sensible choice is to define h=η/(1+η) and assign a uniform prior Unif(0,1) on h. Then η has a probability density function f(η)=1/(1+η)2, which is heavy tailed [9]. This full Bayesian approach is advantageous in principle, as it accounts for variation of η, but the computation is difficult, as this prior cannot be integrated out analytically, and either sampling or numerical integration are required for computation. For example, Wen [10] took a full Bayesian approach assigning priors on η and τ, and elected to compute approximate Bayes factors for LMM. On the other hand, by plugging in ML estimate ηˆ, the subsequent computation can be done analytically. And this empirical Bayes approach is considered approximation to the full Bayesian treatment.

Finally, Bayes factor is more desirable than p‐values in applications that require comparing multiple non‐nested alternative models. One such example is comparing genotype effect, paternal effect, and maternal effect, and paternal‐maternal joint effects of the same SNP. To compare two alternative models such as paternal effect and maternal effect, one can simply divide two Bayes factors to obtain a valid Bayes factor between two models [4], while it is difficult to derive a valid p‐value (from two p‐values) to compare the two models. More details can be found in our manuscript on parent‐of‐origin effect eQTL [11]. Methods developed here are implemented in a software package IDUL [3].

4 METHODS

4.1 Computation

Bayes factor Equation (8) can be evaluated efficiently. This computation was documented previously [8], and we reproduced it here for context clarity. As XtX+VX−1=In+1ηDQtWWtQWtW and denote F=In+1ηD−1, M=WtW−WtQFQtW−1, we compute its determinant using the identity |ABCD|=|A|·|D−CA−1B| to get

(13)|XtX+VX−1|=|In+1ηD|·|WtW−WtQFQtW|;

Using the identities

(13)ABCD−1=A−1+A−1BD−CA−1B−1CA−1,−A−1BD−CA−1B−1−D−CA−1B−1CA−1,D−CA−1B−1,

we get

(14)XtX+VX−1−1=F+FQtWMWtQF,−FQtWM−MWtQF,M.

Note that for large matrices the computation only involves an inexpensive matrix multiplying vector, without expensive matrix multiplication and matrix inversion. Specifically, in computing FQtW, Qt is n by n, W is n by p with p≪n. So that computing T=QtW consists of p matrix‐vector multiplication. Since F is a diagonal, computing FT is just linearly scaling the rows of T. For small matrices such WtW and M, which are p by p, the multiplication and inversion are inexpensive. The only expensive calculation is the eigen decomposition to obtain Q and D, which only needs to be done once. Similarly, both |(X,x)t(X,x)+V(X,x)−1| and (X,x)t(X,x)+V(X,x)−1−1 can be efficiently computed. Finally,

(15)ba=XtX+VX−1−1·QtyWty=F+FQtWMWtQF,−FQtWM−MWtQF,M·QtyWty=FQty+FQtWMWtQFQty−FQtWMWty−MWtQFQty+MWty.

4.2 Least square projection

Let Qj be the j‐th column of Q, and consider model Qj=Gβj+ϵj. The least square estimates of βj=G−1Qj. For a new observation g, the prediction on the Qj is gG−1Qj. Since this is true for each j, we have the least square prediction onto Q based on genetic relatedness is gG−1Q. The same arguments apply to Z as well.

4.3 Equivalence

With the notations defined in the main text, we aim to show aˆ=a˜ and Qbˆ=Zu˜. With reference to Equation (15) and the fact that QFQt=In−H−1, we have

(16)aˆ=−MWtQFQty+MWty=−MWtIn−H−1y+MWty=MWtH−1y=WtH−1W−1WtH−1y=a˜,

and

(17)Qbˆ=QFQty+QFQtWMWtQFQty−QFQtWMWty=QFQty+QFQtWMWtIn−H−1y−QFQtWMWty=QFQty−QFQtWMWtH−1y=In−H−1y−WMWtH−1y=H−InH−1y−Wa˜=ηZKZtH−1y−Wa˜=Zu˜.

References

[1]

Zhou X, Stephens M. Genome‐wide efficient mixed‐model analysis for association studies. Nat Genet. 2012;44(7):821–824.

[2]

Henderson CR. Best linear unbaised estimation and prediction under a selection model. Biometrics. 1975;31(2):423–447.

[3]

Guan Y, Levy D. Asymptotically exact fit for linear mixed model in genetic association studies. Genetics. 2024;228(2):iyae143.

[4]

Kass RE, Raftery AE. Bayes factors. J Am Stat Soc. 1995;90(430):773–795.

[5]

Robinson G. That BLUP is a good thing: the estimation of random effects (with discussions). Stat Sci. 1991;6(1):15–51.

[6]

Servin B, Stephens M. Imputation‐based analysis of association studies: candidate regions and quantitative traits. PLoS Genet. 2007;3(7):1–13.

[7]

Zhou Q, Guan Y. On the null distribution of Bayes factors in linear regression. J Am Stat Soc. 2018;113(523):1362–1371.

[8]

Guan Y, Levy D. Estimation of inbreeding and kinship coefficients via latent identity‐by‐descent states. Bioinformatics. 2024;40(2):btae082.

[9]

Guan Y, Stephens M. Bayesian variable selection regression for genome‐wide association studies and other large‐scale problems. Ann Appl Stat. 2011;5(3):1780–1815.

[10]

Wen X. Bayesian model comparison in genetic association analysis: linear mixed modeling and SNP set testing. Biostatistics. 2015;16(4):701–712.

[11]

Guan Y, Huan T, Levy D. Abundant parent‐of‐origin effect EQTL: the Framingham Heart Study. eLife. 2025;14:RP107920.

Rights & permissions

Published 2026. This article is a U.S. Government work and is in the public domain in the USA. Quantitative Biology published by John Wiley & Sons Australia, Ltd on behalf of Higher Education Press.

PDF (358KB)

0

Accesses

0

Citation

Detail

Sections
Recommended

/

〈 〉