Tutorials › Statistical Genetics › Epistatic Relationship Matrices For Genome-Wide Models

Architecture Beyond Additive Effects · Tutorial 584 of 989

Epistatic Relationship Matrices For Genome-Wide Models

Learn how marker-level additive relationships produce additive-by-additive kernels and how those kernels enter a genome-wide variance-component model.

Advanced 12 min read

What You'll Learn

  • Define a centered marker-score matrix and construct the additive genomic relationship matrix.
  • Derive the additive-by-additive matrix as a Hadamard product and explain what it includes.
  • Distinguish an all-pairs product kernel from a kernel restricted to distinct loci.
  • Interpret the additive-by-additive variance component in a random-effects model.
  • Identify assumptions needed to estimate and interpret genome-wide epistatic variance.

Why Build an Epistatic Relationship Matrix?

A genome-wide model can represent additive genetic resemblance with a relationship matrix whose entries summarize how similar two individuals are across markers. To represent additive-by-additive epistasis, the model needs a different kernel: one that summarizes similarity in products of additive marker scores. The matrix is a way to encode that resemblance across all individuals without estimating every pairwise interaction as a separate fixed effect.

The construction has an important detail. Squaring an additive relationship matrix entry by entry produces a useful all-pairs product kernel, but it includes products involving the same marker as well as products involving distinct markers. When the scientific target is strictly interaction between two different loci, the corresponding matrix can be built directly from distinct-locus score products.

Definition: Let \(Z\) be an \(n \times m\) matrix of additive marker scores for \(n\) individuals and \(m\) markers. Write \(z_{ij}\) for the score of individual \(i\) at marker \(j\). Scores are centered across the modeled population and may be scaled using allele frequencies or another stated convention. The additive genomic relationship matrix is \(K_A=ZZ^\mathsf{T}/m\), with entry \(K_{A,il}=m^{-1}\sum_{j=1}^{m}z_{ij}z_{lj}\). The Hadamard product \(A\circ B\) is the element-by-element product of matrices of the same dimensions.

The scale of \(K_A\) depends on how marker scores are coded and scaled. A common choice under Hardy–Weinberg equilibrium is to center a genotype count by its expectation \(2p_j\) and divide by \(\sqrt{2p_j(1-p_j)}\), where \(p_j\) is the allele frequency used for marker \(j\). With that coding, the score has variance one under the assumed genotype distribution. In practice, allele frequencies, missing-data handling, and any further matrix scaling should be specified, because they affect the numerical scale of the variance component.

From Marker Relationships to an Additive-by-Additive Kernel

For each pair of individuals \(i\) and \(l\), the squared additive relationship is

$$ (K_A\circ K_A)_{il} = \left(\frac{1}{m}\sum_{j=1}^{m}z_{ij}z_{lj}\right)^2 = \frac{1}{m^2}\sum_{j=1}^{m}\sum_{k=1}^{m} (z_{ij}z_{ik})(z_{lj}z_{lk}). $$

This expansion shows why the Hadamard square represents product-score resemblance. It compares the product of an individual's scores at markers \(j\) and \(k\) with the corresponding product for another individual. The sum includes all ordered pairs \((j,k)\), including \(j=k\). For \(j\ne k\), reversing the order gives the same product, so each distinct unordered pair appears twice.

A conventional additive-by-additive kernel is therefore \(K_{AA}=K_A\circ K_A\). Its definition is precise and convenient, but its interpretation is an all-pairs product kernel, not exclusively a sum over distinct two-locus interactions. If the target is only interactions between different loci, construct the matrix from those pair features directly.

Definition: For a kernel containing only distinct marker pairs, define \(v_{i,jk}=z_{ij}z_{ik}\) for \(j<k\), and let \(V\) be the matrix with rows indexed by individuals and columns by distinct marker pairs. One normalized distinct-locus relationship matrix is \(K_{AA}^{\mathrm{distinct}}=VV^\mathsf{T}/\binom{m}{2}\), for \(m\ge 2\). Its normalization is a convention; the corresponding variance component must use the same convention.

These two constructions are related, but they need not be numerically identical. In particular, \(K_A\circ K_A\) contains the terms \(z_{ij}^{2}z_{lj}^{2}\) from \(j=k\), whereas \(K_{AA}^{\mathrm{distinct}}\) omits them. A model should state which kernel it uses rather than treating the labels “additive-by-additive” and “Hadamard square” as interchangeable in every interpretation.

Worked Example: Computing the Hadamard-Square Kernel

Consider three hypothetical individuals and two centered marker-score columns:

$$ Z= \begin{pmatrix} 1&0\\ 0&1\\ -1&-1 \end{pmatrix}. $$

There are \(m=2\) markers, so \(K_A=ZZ^\mathsf{T}/2\). The dot products of the score rows are \(1\) for individual 1 with itself, \(0\) for individuals 1 and 2, \(-1\) for individuals 1 and 3, \(1\) for individual 2 with itself, \(-1\) for individuals 2 and 3, and \(2\) for individual 3 with itself. Dividing each by 2 gives

$$ K_A= \begin{pmatrix} 0.5&0&-0.5\\ 0&0.5&-0.5\\ -0.5&-0.5&1 \end{pmatrix}. $$

The entry for individuals 1 and 2 is zero because their marker-score rows have dot product \(1(0)+0(1)=0\). Squaring each matrix entry separately gives

$$ K_A\circ K_A= \begin{pmatrix} 0.25&0&0.25\\ 0&0.25&0.25\\ 0.25&0.25&1 \end{pmatrix}. $$

Thus, under this all-pairs convention, the product-kernel resemblance between individuals 1 and 2 is zero, while the resemblance between either of them and individual 3 is \(0.25\). This is a small algebraic illustration; marker scores in an applied analysis would need to follow the selected coding and scaling convention.

Why the Kernel Is a Valid Covariance Structure

A relationship matrix used as a covariance matrix must be positive semidefinite: for every vector \(a\), \(a^\mathsf{T}Ka\ge 0\). The additive matrix has this property because it is a scaled Gram matrix. Specifically, \(a^\mathsf{T}K_Aa=(Z^\mathsf{T}a)^\mathsf{T}(Z^\mathsf{T}a)/m\ge 0\).

The Hadamard square is also positive semidefinite. One justification is to write each row of \(Z\) as a vector \(z_i\). The entry \(K_{A,il}\) is the inner product \(z_i^\mathsf{T}z_l/m\), so its square is the inner product between the tensor-product feature vectors \(z_i\otimes z_i\) and \(z_l\otimes z_l\), divided by \(m^2\). Thus \(K_A\circ K_A\) is itself a Gram matrix. Equivalently, the Schur product theorem states that the element-by-element product of two positive semidefinite matrices is positive semidefinite. The distinct-locus matrix is also a Gram matrix, since it is proportional to \(VV^\mathsf{T}\).

Justification: A kernel made from feature vectors \(q_i\) has entries \(K_{il}=q_i^\mathsf{T}q_l\). For any vector \(a\), \(a^\mathsf{T}Ka=\|\sum_i a_iq_i\|^2\ge 0\). This establishes the required covariance property for both the tensor-product features underlying \(K_A\circ K_A\) and the distinct-pair features in \(V\).

Variance-Component Interpretation

A genome-wide additive-by-additive relationship matrix is commonly used in a linear mixed model. For a quantitative phenotype vector \(y\), one possible model is

$$ y=X\beta+g_A+g_{AA}+e, \qquad g_A\sim N(0,\sigma_A^2K_A), \qquad g_{AA}\sim N(0,\sigma_{AA}^2K_{AA}), \qquad e\sim N(0,\sigma_e^2I). $$

Here \(X\) is the fixed-effect design matrix, \(\beta\) is its coefficient vector, \(I\) is the identity matrix, and the random terms are assumed mutually independent. \(K_{AA}\) must be defined explicitly as either the all-pairs Hadamard-square kernel or a distinct-locus kernel. Under the stated model, the phenotype covariance is

$$ \operatorname{Var}(y)= \sigma_A^2K_A+\sigma_{AA}^2K_{AA}+\sigma_e^2I. $$

The parameter \(\sigma_{AA}^2\) is the variance scale attached to the chosen kernel in the modeled population. It is not automatically a scale-free percentage of genetic variance: its numerical value depends on the kernel's normalization, marker coding, and model specification. A proportion such as \(\sigma_{AA}^2/(\sigma_A^2+\sigma_{AA}^2+\sigma_e^2)\) has an interpretation as a variance fraction only when the component scales and the target population make those terms commensurate.

One way to see the connection with interaction effects is to let \(q_{jk}\) be the vector across individuals whose \(i\)th element is \(z_{ij}z_{ik}\). If distinct-pair effects are independent with mean zero and common variance \(\tau^2\), then \(g_{AA}=\sum_{j<k}q_{jk}\gamma_{jk}\) has covariance \(\tau^2\sum_{j<k}q_{jk}q_{jk}^\mathsf{T}\). With \(K_{AA}^{\mathrm{distinct}}=VV^\mathsf{T}/\binom{m}{2}\), this is \(\sigma_{AA}^2K_{AA}^{\mathrm{distinct}}\) when \(\sigma_{AA}^2=\binom{m}{2}\tau^2\). The relationship-matrix variance component therefore aggregates the assumed variance of many interaction effects.

Worked Example: Interpreting a Kernel Variance Component

Suppose a hypothetical analysis uses the Hadamard-square matrix from the first example and estimates \(\sigma_{AA}^2=4\) phenotype-units squared. The additive-by-additive contribution to the covariance between individuals 1 and 3 is

$$ \sigma_{AA}^2K_{AA,13}=4(0.25)=1 \quad\text{phenotype-units}^2. $$

For individual 3, the corresponding contribution to its phenotype variance is \(4K_{AA,33}=4(1)=4\) phenotype-units squared. For individuals 1 and 2, it is \(4(0)=0\). These are contributions from this component only; the total covariance also includes any other modeled components, such as additive and residual covariance. The calculation does not show that an interaction caused a phenotype difference. It describes the covariance structure assumed by the fitted model.

Constructing a Distinct-Locus Matrix

The next example makes the distinction between all-pairs and distinct-locus kernels concrete. For three markers there are \(\binom{3}{2}=3\) unordered distinct pairs. Compute one product feature per pair and individual, then take the normalized Gram matrix.

Worked Example: Building the Distinct-Pair Kernel

Take the following hypothetical centered marker-score matrix, with rows for three individuals and columns for three markers:

$$ Z= \begin{pmatrix} 1&1&0\\ 1&0&1\\ -2&-1&-1 \end{pmatrix}. $$

The columns are centered: their respective sums are \(1+1-2=0\), \(1+0-1=0\), and \(0+1-1=0\). In the order \((1,2),(1,3),(2,3)\), the product features for the three individuals are \((1,0,0)\), \((0,1,0)\), and \((2,2,1)\). Thus

$$ V= \begin{pmatrix} 1&0&0\\ 0&1&0\\ 2&2&1 \end{pmatrix}, \qquad K_{AA}^{\mathrm{distinct}} =\frac{VV^\mathsf{T}}{3} = \begin{pmatrix} 1/3&0&2/3\\ 0&1/3&2/3\\ 2/3&2/3&3 \end{pmatrix}. $$

For example, the unnormalized inner product between individuals 1 and 3 is \(1(2)+0(2)+0(1)=2\), and division by three gives \(2/3\). This matrix includes only the three distinct marker pairs. Its scale and entries differ from those of \(K_A\circ K_A\), which also uses same-marker terms.

Assumptions for Genome-Wide Estimation

The matrix construction is algebraic; interpreting an estimated component as genome-wide epistatic variance requires additional assumptions. The model should state how genotype scores and allele frequencies were defined, how missing genotypes were handled, and how each kernel was normalized. Marker scores should represent the intended population and be coded consistently across individuals. Poorly handled missingness or frequency differences can change the relationship structure rather than merely reduce precision.

The mixed-model interpretation also depends on the random-effects assumptions. Effects represented by a kernel are modeled as mean-zero random quantities with a covariance proportional to that kernel. The residual covariance must be specified, and fixed effects in \(X\) should account for relevant design variables and population structure. The components are most straightforward to distinguish when their covariance patterns are sufficiently different in the sample. If kernels are strongly correlated, the data may provide limited information for allocating covariance uniquely among them. Linkage disequilibrium can affect that separation and the interpretation of component estimates; the kernel alone does not remove that issue.

Genome-wide estimates are estimates for the modeled marker set and population under these assumptions. They do not imply that every marker pair has an effect, that all interactions share the same biological mechanism, or that the estimated component will transport unchanged to another population. A variance-component estimate is a summary of covariance captured by a specified model, not a list of identified causal interactions.

1
Choose the score coding.
Specify marker centering, scaling, frequency reference, and missing-data treatment.
2
Define the interaction kernel.
Use \(K_A\circ K_A\) for the all-pairs product kernel, or build \(V\) from \(j<k\) products for a distinct-locus kernel.
3
Specify the covariance model.
State fixed effects, random-effect covariance matrices, residual structure, and the independence assumptions.
4
Interpret on the selected scale.
Relate the estimated variance component to its kernel normalization and the population being modeled.

Common Mistakes

  • Using a wrong dot product. The entry \(K_{A,il}\) is the dot product of rows \(i\) and \(l\), divided by \(m\). For score rows \((1,0)\) and \((0,1)\), that dot product is zero, not one.
  • Confusing elementwise and ordinary matrix squaring. \(K_A\circ K_A\) squares each entry. It is not the matrix product \(K_AK_A\).
  • Calling every Hadamard square a strictly distinct-locus kernel. Its expansion includes \(j=k\) terms. Use a product-feature matrix indexed by \(j<k\) when distinct loci are required.
  • Ignoring normalization. Rescaling a relationship matrix changes the numerical variance component attached to it. Compare variance estimates only after checking the kernel definition and scale.
  • Interpreting covariance as causation. A positive kernel component describes covariance under a statistical model; it does not establish a biological mechanism or identify causal marker pairs.
Key takeaway: The Hadamard square of the additive relationship matrix is a positive-semidefinite all-pairs product kernel. A distinct-locus additive-by-additive kernel is built from products \(z_{ij}z_{ik}\) with \(j<k\). Either can support a genome-wide variance component, provided the kernel, scaling, model assumptions, and population interpretation are explicit.

Check Your Understanding

Answer each question using the definitions and assumptions stated above.

  1. For two marker-score rows \((1,0)\) and \((0,1)\), what is their additive relationship when \(m=2\), and why?
  2. Explain why \(K_A\circ K_A\) includes more than products between distinct markers.
  3. What feature matrix would you construct to define a kernel containing only distinct marker pairs?
  4. If a kernel is multiplied by a positive constant, what must be considered when interpreting its estimated variance component?
  5. In the mixed model, what does \(\sigma_{AA}^2K_{AA,il}\) represent, and what does it not establish?
Clinical Biostats