It is a method used to estimate variance components in statistical models, especially in linear mixed models.
REML is very common in:
statistical genetics,
animal breeding,
GWAS mixed models,
heritability estimation,
longitudinal data analysis,
repeated-measures analysis,
multi-level modeling.
In statistical genetics, REML appears frequently in methods such as:
GCTA-GREML,
genomic relationship matrix models,
SNP heritability estimation,
variance component models.
The main purpose of REML is to estimate variance parameters more accurately than ordinary maximum likelihood, especially when fixed effects are present.
1 Why Do We Need REML?
In many statistical models, we estimate two types of parameters:
fixed effects,
variance components.
Fixed effects describe average effects.
For example:
age effect,
sex effect,
SNP effect,
treatment effect,
batch effect.
Variance components describe sources of variability.
For example:
genetic variance,
residual variance,
family-level variance,
individual-level random effects,
environmental variance.
A mixed model may look like this:
$ y = X+ Zu + $
where:
( y ) is the phenotype,
( \(X\beta\) ) represents fixed effects,
( Zu ) represents random effects,
( \(\epsilon\) ) is residual error.
The random effects are usually assumed to follow:
$ u N(0, _u^2 I) $
and the residual errors are:
$ N(0, _e^2 I) $
The goal is often to estimate:
$ _u^2 $
and:
$ _e^2 $
These are variance components.
1.1 Maximum Likelihood
Maximum likelihood estimation, often abbreviated as ML, estimates parameters by finding values that make the observed data most likely.
In simple terms, ML asks:
Given this model, what parameter values make my observed data most probable?
For a linear model:
$ y = X+ $
ML estimates both:
fixed effects,
variance parameters
using the same likelihood.
However, this creates a problem.
1.2 The Problem with Ordinary Maximum Likelihood
Ordinary maximum likelihood tends to underestimate variance components.
This happens because ML does not fully account for the fact that fixed effects were estimated from the data.
When we estimate fixed effects, we use some information from the data.
That reduces the remaining independent information available for estimating variance.
In simple linear regression, this is why we estimate residual variance using:
$ $
instead of:
$ $
where:
( n ) is the number of observations,
( p ) is the number of estimated fixed-effect parameters.
The term ( n-p ) accounts for the degrees of freedom lost by estimating fixed effects.
REML is based on a similar idea.
1.3 What REML Does
REML estimates variance components after accounting for the fixed effects.
Instead of using the likelihood of the raw data ( y ), REML uses the likelihood of transformed data that no longer depends on the fixed effects.
Conceptually, REML removes the part of the data explained by fixed effects and estimates variance components from the remaining residual variation.
This gives less biased variance estimates.
1.4 REML Meaning
REML is called Restricted Maximum Likelihood because the likelihood is constructed from a restricted part of the data.
It is also sometimes called:
residual maximum likelihood,
restricted likelihood,
marginal likelihood of error contrasts.
The key idea is:
Estimate variance components using only the part of the data that is independent of fixed-effect estimates.
1.5 Simple Example: Variance Estimation
Suppose we have a simple linear regression:
$ y_i = _0 + _i $
Here, the only fixed effect is the intercept.
If we estimate variance using ML:
$ ^2_{ML} = _{i=1}^{n}(y_i - {y})^2 $
But the usual unbiased estimate is:
$ ^2 = _{i=1}^{n}(y_i - {y})^2 $
Why ( n-1 )?
Because one parameter, the mean, was estimated.
REML generalizes this correction to more complex mixed models.
1.5.1 ML vs REML
Feature
ML
REML
Estimates fixed effects
Yes
Indirectly
Estimates variance components
Yes
Yes
Accounts for loss of fixed-effect degrees of freedom
No
Yes
Variance estimates
Often downward biased
Less biased
Good for comparing fixed effects
Yes
No, if fixed effects differ
Good for estimating variance components
Less preferred
Preferred
1.6 Important Practical Rule
Use ML when comparing models with different fixed effects.
Use REML when comparing models with the same fixed effects but different random effects or when the main goal is estimating variance components.
Why?
Because REML likelihood depends on the fixed-effect design matrix.
Therefore, REML likelihoods are not directly comparable across models with different fixed effects.
1.7 REML in Linear Mixed Models
A linear mixed model can be written as:
$ y = X+ Zu + $
where:
$ u N(0, G) $
and:
$ N(0, R) $
Then:
$ y N(X, V) $
where:
$ V = ZGZ^T + R $
The matrix ( V ) is the covariance matrix of the phenotype.
REML estimates the variance components inside ( V ).
1.8 REML in Statistical Genetics
In statistical genetics, REML is especially important because we often want to estimate how much trait variation is explained by genetic similarity.
A common model is:
$ y = X+ g + $
where:
$ g N(0, G_g^2) $
and:
$ N(0, I_e^2) $
Here:
( G ) is the genetic relationship matrix,
( _g^2 ) is genetic variance,
( _e^2 ) is residual variance.
The total phenotypic variance is:
$ _p^2 = _g^2 + _e^2 $
SNP heritability is estimated as:
$ h^2_{SNP} = {_g^2 + _e^2} $
REML is used to estimate ( \(\sigma_g^2\) ) and ( \(\sigma_e^2\) ).
1.9 Intuition for REML Heritability Estimation
The idea is simple:
If genetically similar individuals also have similar phenotypes, then genetic variance is large.
If genetic similarity does not predict phenotype similarity, then genetic variance is small.
REML helps estimate how much phenotype covariance can be explained by the GRM.
1.10 Why REML Is Used in GCTA-GREML
GCTA-GREML uses REML to estimate SNP heritability.
The model is:
$ y = X+ g + $
with:
$ g N(0, G_g^2) $
REML estimates:
genetic variance,
residual variance,
SNP heritability.
The GRM defines expected genetic covariance between individuals.
REML estimates how strongly this covariance structure explains the observed phenotype.