Why Construct a Genomic Relationship Matrix?
A genotype table records one dosage for each individual at each marker. A genomic relationship matrix (GRM) turns that table into a square matrix whose rows and columns correspond to individuals. Its entries summarize how similar pairs of individuals are across the included markers, relative to a specified set of allele frequencies. This makes it possible to represent genome-wide similarity in a form that can be examined, compared with pedigree relationships, or used in later statistical models.
The reference allele frequencies and the normalization matter: a GRM is not an absolute measure of similarity independent of its construction. Here we use a common unstandardized, frequency-centered construction. It centers each dosage by its expected value under the chosen allele frequency, then scales the whole matrix by the summed genotype variances. This gives diagonal and off-diagonal values a useful relationship interpretation under additional genetic assumptions.
Definition and Construction
Suppose \(n\) individuals have dosages at \(m\) autosomal, biallelic markers. Let \(g_{ij}\in\{0,1,2\}\) be the number of copies of the designated allele for individual \(i\) at marker \(j\), and let \(p_j\) be the allele frequency used for that marker. The expected dosage under random mating is \(2p_j\), so the centered dosage is \(w_{ij}=g_{ij}-2p_j\). Collect these values in the \(n\times m\) matrix \(W\).
The numerator is a sum of products of centered dosages. At a marker where both individuals have dosages above their frequency-based expectations, or both have dosages below them, the product is positive. If one dosage is above and the other below, the product is negative. The denominator puts the sum on a scale tied to the total genotype variance expected across markers under Hardy–Weinberg equilibrium.
This construction assumes diploid dosage coding and uses the same marker set and frequency values for all entries. The algebraic definition does not require markers to be independent. However, interpreting the matrix as a stable summary of genome-wide similarity is more reliable when the data contain many informative, reasonably distributed markers; strong linkage disequilibrium can make some genomic regions contribute redundant information.
What the Entries Summarize
The diagonal entry \(K_{ii}\) summarizes an individual’s centered dosage products with itself. It is nonnegative, since its numerator is a sum of squares. A diagonal near 1 is a useful reference under a simple model of an outbred individual sampled from the population used to define the frequencies. It is not a required value for every individual: finite marker counts, allele-frequency choices, inbreeding, and population composition can all affect it.
An off-diagonal entry \(K_{ik}\) summarizes the products of the two individuals’ centered dosages across markers. Positive values indicate that their dosage deviations tend to point in the same direction relative to the chosen frequencies; negative values indicate a tendency to point in opposite directions. Values near zero indicate little aggregate centered covariance, not proof that the individuals share no ancestry or have no biological relationship.
Under random mating, a common population allele frequency at each marker, and a model in which the individuals’ genomes have a pedigree additive relationship \(A_{ik}\), the expected centered product at marker \(j\) is \(2p_j(1-p_j)A_{ik}\). Here \(A_{ik}\) is the additive relationship coefficient, equal to twice the kinship coefficient for a pair of individuals. For an outbred individual, the corresponding diagonal expectation is 1; with inbreeding coefficient \(F_i\), it is \(1+F_i\). Summing the marker expectations and dividing by the denominator explains why this GRM is often interpreted as a genomic analogue of an additive relationship matrix. These are model-based expectations, not guarantees that each realized matrix entry equals its pedigree value.
Worked Calculations
Worked Example: Constructing a Small Matrix
Consider three hypothetical individuals and three markers. Use the following dosages and reference allele frequencies:
| Individual | Marker 1, \(p_1=0.50\) | Marker 2, \(p_2=0.25\) | Marker 3, \(p_3=0.50\) |
|---|---|---|---|
| A | 0 | 1 | 1 |
| B | 1 | 0 | 1 |
| C | 2 | 1 | 0 |
The expected dosages \(2p_j\) are \(1, 0.5, 1\). Subtracting them gives the centered rows \(W_A=(-1,0.5,0)\), \(W_B=(0,-0.5,0)\), and \(W_C=(1,0.5,-1)\). The denominator is
For individual A, the diagonal numerator is \((-1)^2+(0.5)^2+0^2=1.25\), so \(K_{AA}=1.25/1.375=0.9091\). For B it is \(0^2+(-0.5)^2+0^2=0.25\), giving \(K_{BB}=0.1818\). For C it is \(1^2+(0.5)^2+(-1)^2=2.25\), giving \(K_{CC}=1.636\).
For the off-diagonal entries, the numerators are \(W_AW_B^\mathsf{T}=-0.25\), \(W_AW_C^\mathsf{T}=-0.75\), and \(W_BW_C^\mathsf{T}=-0.25\). Dividing each by 1.375 gives the symmetric matrix
In this small hypothetical data set, the centered dosage products for A and C sum to a negative value, so their off-diagonal entry is negative relative to these frequencies. The unusually high and low diagonals should not be treated as precise estimates of individual inbreeding: three markers provide very little information.
Worked Example: Reading One Marker’s Contribution
At a hypothetical marker with \(p=0.30\), suppose two individuals have dosages 1 and 2. Their centered dosages are \(1-0.60=0.40\) and \(2-0.60=1.40\). The product contributing to the off-diagonal numerator is \(0.40(1.40)=0.56\). The marker’s contribution to the denominator is \(2(0.30)(0.70)=0.42\). If this were the only marker, the resulting entry would be \(0.56/0.42=1.333\).
That value illustrates the formula, not a dependable relationship estimate: one marker cannot provide a stable genome-wide summary. The product is positive because both dosages exceed the frequency-based expectation. If the first dosage were instead 0, its centered value would be \(-0.60\); paired with the second individual’s \(1.40\), the product would be \(-0.84\), and the one-marker entry would be \(-0.84/0.42=-2.000\). The sign and magnitude describe centered dosage similarity at this marker under this normalization.
Worked Example: Cohort Frequencies and a Matrix Check
Consider three hypothetical individuals at two markers, with dosage rows \((0,0)\), \((1,1)\), and \((2,2)\). If frequencies are estimated from these three individuals, both markers have \(\hat p=3/(2\cdot3)=0.50\). The centered rows are \((-1,-1)\), \((0,0)\), and \((1,1)\), and the denominator is \(2[0.25+0.25]=1\). The resulting matrix is
The middle individual has dosage equal to the expected dosage at both markers, so its centered row is zero and its row and column in \(K\) are zero. Because the columns were centered using frequencies from these same individuals, their centered values sum to zero; accordingly, every row of this matrix sums to zero. This is a consequence of cohort centering, not a claim that the individuals have no relationships.
Why the Matrix Is Symmetric and Positive Semidefinite
These two properties are immediate checks on a correctly constructed matrix. Symmetry follows because the product of centered row \(i\) with centered row \(k\) is the same as the product in the reverse order. Positive semidefiniteness means that \(a^\mathsf{T}Ka\geq0\) for every real vector \(a\) of length \(n\). It follows directly from the construction:
The denominator is positive by construction, and a squared length cannot be negative. This also explains why a GRM made this way cannot have genuinely negative eigenvalues, although software may report tiny negative values due to numerical rounding. Its rank cannot exceed the number of markers, and centering by frequencies estimated in the cohort can reduce the rank further.
Choices, Diagnostics, and Limitations
The centering frequencies define the baseline against which similarity is measured. Frequencies estimated from the analyzed cohort make each marker’s centered dosages sum to zero within that cohort. Frequencies from a reference population instead measure deviations from that reference. Either choice can be appropriate, but the resulting entries answer different questions. Using mismatched frequencies or inconsistent marker sets across matrix entries can create misleading comparisons.
A common alternative standardizes each marker separately by its genotype standard deviation, producing a matrix based on terms such as \((g_{ij}-2p_j)/\sqrt{2p_j(1-p_j)}\), often averaged over markers. This gives each marker a different relative weight from the construction used here. A raw covariance matrix, by contrast, omits the frequency-variance normalization. These matrices are related but their numerical values are not interchangeable; always state the construction before interpreting an entry.
Useful checks include confirming that \(K\) is symmetric, that its diagonal entries are nonnegative, and that its eigenvalues are nonnegative up to numerical tolerance. Inspect the diagonal and off-diagonal distributions for unexpected extremes, and verify that all entries were computed using the intended frequencies and markers. A large diagonal or off-diagonal value can reflect limited marker information, frequency choice, population structure, or close relatedness; the matrix alone does not identify which explanation applies.
Markers in linkage disequilibrium contribute correlated information. The formula remains valid as a matrix construction, but a long correlated region can make the apparent information less dispersed across the genome than the marker count suggests. Also, missing dosages should not silently be treated as zero: zero is a valid dosage and, after centering, has a specific meaning. The data and implementation must use a consistent strategy for missingness before interpreting the matrix.
Common Mistakes
- Interpreting \(K_{ik}\) as a probability. It is a normalized sum of centered products and can be negative or greater than 1; it is not a probability that a pair shares alleles.
- Assuming every diagonal must equal 1. One is a model-based reference for an outbred individual, not a constraint imposed by the matrix formula.
- Comparing entries from different constructions as if they shared a scale. Changing frequencies, marker sets, or per-marker scaling changes the meaning and often the magnitude of entries.
- Calling a negative off-diagonal value evidence of a biological relationship of a particular type. It indicates negative aggregate centered dosage covariance relative to the chosen frequencies; further analysis is needed to explain it.
The central interpretation is therefore conditional: a GRM summarizes genomic similarity relative to its allele-frequency baseline and normalization. Its matrix properties are guaranteed by construction, while a biological interpretation of any particular entry depends on the population and genetic assumptions used.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- For one marker with \(p=0.50\), individual A has dosage 0 and individual B has dosage 2. What is their centered product, and what is its contribution after dividing by the one-marker denominator?
- Why is a diagonal entry nonnegative? State the algebraic property that guarantees it.
- If allele frequencies are estimated in the same cohort, what is true of the sum of centered dosages at each marker?
- Does a negative off-diagonal entry mean that the pair has a negative probability of sharing alleles? Explain.
- Name two checks that can help identify a coding or construction problem in a computed GRM.
Solutions. For question 1, the centered dosages are \(-1\) and \(1\), so their product is \(-1\). The denominator is \(2(0.5)(0.5)=0.5\), giving a one-marker entry of \(-1/0.5=-2\). For question 2, the diagonal numerator is a sum of squared centered dosages, and the denominator is positive; therefore it cannot be negative. For question 3, the centered dosages sum to zero at each marker, because the cohort mean dosage equals \(2\hat p_j\). For question 4, no: the entry is a normalized centered dosage product, not a probability. For question 5, check symmetry and nonnegative eigenvalues up to numerical tolerance; also confirm that diagonal entries are nonnegative and that the same frequencies and marker set were used consistently.