Why Estimate Variance Components by REML?
In a genetic mixed model, the covariance among observations is partly attributed to a genomic relationship matrix and partly to residual variation. Estimating these sources of variation requires accounting for fixed effects, such as an intercept or covariates. Restricted maximum likelihood (REML) does this by basing its likelihood on contrasts that eliminate the fixed-effect mean. This tutorial develops the estimation steps for one genetic covariance kernel and shows how to assess an iterative fit.
The One-Kernel Model and Its REML Likelihood
Let \(y\) be an \(n\)-vector of quantitative outcomes, \(X\) an \(n \times p\) fixed-effect design matrix of full column rank, and \(K\) a known positive semidefinite genomic relationship matrix. Use the model
where \(g\) and \(e\) are independent, \(\beta\) is an unknown fixed-effect vector, and \(\sigma_g^2\) and \(\sigma_e^2\) are nonnegative genetic and residual variance components. Thus \(y\sim N(X\beta,V)\), with \(V=\sigma_g^2K+\sigma_e^2I_n\). The model assumes the covariance structure \(K\) is specified and that the residuals are independent with a common variance. For positive \(\sigma_e^2\), \(V\) is positive definite.
Choose an \(n \times m\) matrix \(Q\) whose columns are orthonormal and span the space orthogonal to the columns of \(X\), where \(m=n-p\). Then \(Q'X=0\), so the contrast vector \(z=Q'y\) does not depend on \(\beta\). Its covariance is
Let \(Q'KQ=U\operatorname{diag}(\lambda_1,\ldots,\lambda_m)U'\), where \(U\) is orthogonal and each \(\lambda_j\geq 0\). Define \(w=U'z\). The transformed contrasts are independent under the model, with \(w_j\sim N(0,v_j)\), where \(v_j=\lambda_j\sigma_g^2+\sigma_e^2\). The REML log likelihood, omitting a constant that does not depend on the variance components, is therefore
Worked Example: Setting Up the Contrast Likelihood
Suppose a hypothetical study has \(n=5\) outcomes and a full-rank fixed-effect design with \(p=2\) columns. There are \(m=n-p=3\) error contrasts. After forming orthonormal contrasts and diagonalizing their projected kernel, suppose the eigenvalues are \(1, 2,\) and \(0.5\). At \(\sigma_g^2=1\) and \(\sigma_e^2=1\), the three contrast variances are
If the squared transformed contrasts are \(w_1^2=3.2,\ w_2^2=2.0,\) and \(w_3^2=1.5\), the restricted log likelihood, omitting its constant, is
The calculation uses three contrasts, not five raw outcomes, because the two fixed-effect directions have been removed. The omitted likelihood constant is the same at all values of the variance components, so it does not affect which values maximize this likelihood.
Scores and the Average-Information Update
Write \(\theta_g=\sigma_g^2\), \(\theta_e=\sigma_e^2\), and \(d_{jg}=\lambda_j,\ d_{je}=1\). Differentiating the restricted log likelihood gives the score component for either variance parameter \(\theta_i\):
The two terms inside the sum compare the observed squared contrast with its model variance. A positive score indicates that a small increase in the corresponding component would increase the log likelihood locally, holding the other component fixed.
The average-information (AI) matrix averages observed and expected information. In the diagonal contrast representation its entries are
An AI step solves \(AI\,\Delta=U\), where \(U=(U_g,U_e)'\), and proposes \(\theta^{new}=\theta+\Delta\). This is a local update, not a guarantee that the proposed point is admissible or increases the likelihood. In practice, an implementation must keep variance estimates nonnegative and check the likelihood after proposed steps.
Worked Example: One Average-Information Step
Use the eigenvalues \(1,2,0.5\) and squared contrasts \(3.2,2.0,1.5\) from the setup example, starting at \((\sigma_g^2,\sigma_e^2)=(1,1)\). The variances are \((2,3,1.5)\). The score contributions before the factor of one-half are
Weighting these contributions by the eigenvalues for the genetic score gives
Substitution into the AI formula gives
Solving \(AI\,\Delta=U\) gives \(\Delta\approx(-0.5000,0.6250)'\). The proposed values are therefore \((0.5000,1.625)\), both nonnegative. Their contrast variances are \(2.125,\ 2.625,\) and \(1.875\). At the starting values, \(\ell_R\approx-2.7319\); at the proposed values,
This proposed step increases the restricted log likelihood. It is a useful check on this particular update, not a general guarantee for every AI step.
Expectation-Maximization Updates
An EM update treats the genetic and residual parts of each transformed contrast as latent components. Write \(w_j=a_j+e_j\), where \(a_j\sim N(0,\sigma_g^2\lambda_j)\) and \(e_j\sim N(0,\sigma_e^2)\) are independent. For \(\lambda_j>0\), the conditional means and variances given \(w_j\) are
Also, \(E(e_j\mid w_j)=\sigma_e^2w_j/v_j\) and \(\operatorname{Var}(e_j\mid w_j)=\sigma_g^2\lambda_j\sigma_e^2/v_j\). The expected complete-data variance estimates yield the following simultaneous EM updates, with \(r\) the number of positive eigenvalues:
A zero eigenvalue contributes no latent genetic variance; its contrast is entirely residual. EM updates are often stable and, under the stated model with exact updates, do not decrease the restricted likelihood. They can converge slowly near an optimum. AI commonly takes larger, faster local steps, but its proposed step needs admissibility and likelihood checks.
Worked Example: Calculating an EM Update
Use the same hypothetical contrasts as the AI example, with starting variances \(\sigma_g^2=\sigma_e^2=1\). For all three eigenvalues, \(v=(2,3,1.5)\), and \(r=m=3\). The genetic update contributions \(E(a_j^2\mid w_j)/\lambda_j\) are
Thus \((\sigma_g^2)^{new}=(1.3000+0.7778+1.0000)/3\approx1.0259\). The residual expected-square contributions are \(0.8+0.5=1.3000\), \(2.0/9+2/3=0.8889\), and \(1.5/2.25+0.5/1.5=1.0000\). Therefore \((\sigma_e^2)^{new}=(1.3000+0.8889+1.0000)/3\approx1.0630\). Both components increase from their starting values, but convergence is not established by a single update.
Convergence Checks in a One-Kernel Fit
A practical fit iterates updates until parameter changes and the score are small, while tracking the restricted likelihood. The score should be assessed relative to the scale of the problem; a small absolute score alone can be misleading when parameters or information differ greatly in scale. Also check that the current variances are admissible and that the AI matrix can be solved reliably. Multiple starting values can help reveal whether an apparent stopping point depends on initialization.
Worked Example: Checking a Stationary Fit
For a separate hypothetical data set, let the eigenvalues again be \(1,2,0.5\), the squared contrasts be \(2.8,2.4,1.2\), and the current variances be \((1,1)\). Then \(v=(2,3,1.5)\). The residual score contributions before the factor of one-half are
They sum to zero. Their eigenvalue-weighted sum is also zero:
Hence \(U_e=U_g=0\). The AI matrix is approximately
Its determinant is approximately \(0.03333\), so it is nonsingular, and solving the AI equation gives a zero step. The restricted log likelihood is
Here the zero score, zero proposed change, nonsingular AI matrix, and current likelihood together support stopping at this point. They do not, by themselves, prove that it is the global maximum; likelihood comparisons from other starting values can provide an additional check.
Common Pitfall and Practical Interpretation
A frequent error is to treat REML as if it used all \(n\) outcomes without accounting for the fixed effects. The restricted likelihood is built from \(m=n-p\) contrasts, and the projected kernel \(Q'KQ\)—not the unprojected \(K\) alone—determines the contrast eigenvalues. Ignoring this adjustment changes the likelihood being optimized and can lead to incorrect variance-component updates.
AI and EM are alternative numerical routes to estimate the same model parameters; neither changes what \(\sigma_g^2\) and \(\sigma_e^2\) mean under the assumed covariance model. A converged estimate is conditional on the specified fixed effects, kernel, and residual assumptions. It describes a fitted covariance decomposition, not a causal effect of genetic variation.
Check Your Understanding
Try these questions without looking back.
- Why does an orthonormal contrast matrix \(Q\) remove the fixed-effect mean from \(Q'y\)?
- For a contrast with eigenvalue \(\lambda_j\), write its model variance and explain what happens to that variance when \(\lambda_j=0\).
- What do the score and AI equations use to compare the observed contrast with its fitted variance?
- Name one practical advantage of an EM update and one advantage of an AI update.
- Why is a zero score not, by itself, proof that a fit is the global maximum?