Why Shared Allele-Frequency Differences Create Covariance
A genotype matrix has individuals in rows and genetic variants in columns. After centering each variant, some individuals may show similar patterns of positive and negative dosage deviations across many variants. This similarity is not necessarily evidence that they are close relatives. It can arise because their ancestry proportions are similar and ancestry groups differ in allele frequencies. The resulting covariance pattern is useful because it compresses many small frequency differences into a shared signal across individuals.
The argument begins with a population mixture model. At locus \(j\), let \(p_{jk}\) be the frequency of the counted allele in ancestry group \(k\). Individual \(i\) has ancestry proportion \(q_{ik}\) from group \(k\), with \(q_{ik}\geq 0\) and \(\sum_{k=1}^K q_{ik}=1\). Let \(G_{ij}\in\{0,1,2\}\) be the diploid allele dosage. Under random union of gametes and the mixture model, the expected dosage is twice the individual's ancestry-weighted allele frequency.
Here the reference proportions sum to one. Centering by \(2\bar p_j\) removes the reference dosage at each locus. If an individual's ancestry proportions differ from the reference, their expected centered dosage need not be zero. The important point is that the differences can recur in a coordinated way across loci: the same ancestry contrast affects every locus where the groups have different allele frequencies.
Deriving the Cross-Individual Covariance
For a transparent covariance definition, consider the expected centered profiles across \(m\) loci, and use divisor \(m\). For individuals \(i\) and \(\ell\), define \(C_{i\ell}=m^{-1}\sum_{j=1}^m d_{ij}d_{\ell j}\). This is an average cross-product across loci, not the sampling covariance of two random genotypes at one locus. Positive values indicate that the expected centered profiles tend to deviate in the same direction across loci; negative values indicate opposing deviations.
For two ancestry groups, write \(q_i\) for individual \(i\)'s proportion from group 1, so their proportion from group 2 is \(1-q_i\). Let \(\delta_j=p_{j1}-p_{j2}\) and let \(\bar q\) be the reference proportion from group 1. The reference frequency is \(\bar p_j=\bar q p_{j1}+(1-\bar q)p_{j2}\). Subtracting this reference from the individual's weighted frequency gives:
Multiplying by two gives \(d_{ij}=2(q_i-\bar q)\delta_j\). Substituting this expression into the covariance definition yields the key result:
The average squared allele-frequency contrast is nonnegative. Thus, in this two-group model, individuals whose ancestry proportions lie on the same side of the reference tend to have positive expected covariance, while individuals on opposite sides tend to have negative covariance. The magnitude increases with both their distances from the reference and the amount of allele-frequency differentiation across the analyzed loci. If the groups have identical frequencies at all included loci, every \(\delta_j=0\), and this ancestry signal is zero.
With \(K\) groups, the same logic applies to the vector of ancestry deviations. The matrix with entries \(C_{i\ell}\) is a Gram matrix of expected centered profiles: it is \(DD^\mathsf{T}/m\), where \(D\) contains the \(d_{ij}\). It is therefore positive semidefinite. Because ancestry proportions sum to one, their deviations have at most \(K-1\) independent dimensions. Consequently, the ancestry-driven profile matrix has rank at most \(K-1\), and may have lower rank if the included loci do not distinguish all ancestry contrasts. This explains why a small number of broad covariance patterns can summarize variation spread across many loci. It does not imply that every observed covariance pattern is ancestry, or that a particular component has a unique biological interpretation.
Worked Example: Two Individuals With Opposing Ancestry Deviations
Suppose two ancestry groups have counted-allele frequencies \(0.20\) and \(0.60\) at locus 1, and \(0.80\) and \(0.40\) at locus 2. Use the reference \(\bar q=0.50\). Consider individual \(i\) with \(q_i=0.25\) and individual \(\ell\) with \(q_\ell=0.75\). Find their expected centered dosage profiles and their cross-product average across the two loci.
For \(q_i=0.25\), the expected allele frequencies are \(0.25(0.20)+0.75(0.60)=0.50\) and \(0.25(0.80)+0.75(0.40)=0.50\). The reference frequencies are \(0.50(0.20)+0.50(0.60)=0.40\) and \(0.50(0.80)+0.50(0.40)=0.60\). Therefore, the expected centered dosage deviations are \(2(0.50-0.40)=0.20\) and \(2(0.50-0.60)=-0.20\).
For \(q_\ell=0.75\), the expected allele frequencies are \(0.75(0.20)+0.25(0.60)=0.30\) and \(0.75(0.80)+0.25(0.40)=0.70\). Subtracting the same reference frequencies and multiplying by two gives deviations \(-0.20\) and \(0.20\). The profiles are opposites, as expected for ancestry proportions equally far on opposite sides of \(0.50\).
Using divisor \(m=2\), their covariance-like cross-product is \(C_{i\ell}=\{(0.20)(-0.20)+(-0.20)(0.20)\}/2=(-0.04-0.04)/2=-0.0400\). The negative value indicates opposing expected centered profiles across these loci. This calculation uses expected dosages, not a claim that observed genotypes must equal those expectations.
From the Model to Observed Genotype Data
Observed genotypes include allele-sampling variation around their expected dosage profiles. To see the distinction, suppose genotypes are conditionally independent between unrelated individuals given their ancestry proportions and the locus-specific frequencies. For two distinct individuals, conditional independence implies that the expected product of their centered dosages at a locus equals the product of their expected centered dosages: \(E[(G_{ij}-2\bar p_j)(G_{\ell j}-2\bar p_j)\mid q_i,q_\ell]=d_{ij}d_{\ell j}\). Averaging over loci therefore recovers the ancestry-profile cross-product in expectation, provided the loci are treated appropriately and the reference frequencies are suitable.
For an individual's own squared centered dosage, however, genotype sampling variance contributes in addition to the squared expected deviation. The diagonal of an observed covariance matrix therefore contains both ancestry-related variation and within-individual genotype variation. Related individuals can also have correlated genotype residuals, violating the conditional independence assumption for distinct individuals. These distinctions matter: covariance across individuals is a useful signal, not a noise-free measurement of ancestry.
Worked Example: How Allele-Frequency Differentiation Controls Signal Strength
Consider three loci with reference frequency \(0.50\) in each locus and group contrasts \(\delta=(0.10,0.30,-0.20)\). These frequencies are possible, for example, if group 1 has frequencies \((0.55,0.65,0.40)\) and group 2 has \((0.45,0.35,0.60)\). Let \(\bar q=0.50\), and compare individuals with \(q_i=0.20\) and \(q_\ell=0.80\).
First calculate the average squared contrast: \((0.10^2+0.30^2+(-0.20)^2)/3=(0.01+0.09+0.04)/3=0.04667\). The two ancestry deviations are \(-0.30\) and \(0.30\). Thus \(C_{i\ell}=4(-0.30)(0.30)(0.04667)=-0.01680\).
The result can be checked locus by locus. The expected centered profiles are \(2(-0.30)\delta=(-0.06,-0.18,0.12)\) and \(2(0.30)\delta=(0.06,0.18,-0.12)\). Their three cross-products are \(-0.0036\), \(-0.0324\), and \(-0.0144\); their average is \(-0.0504/3=-0.01680\). The larger contrasts contribute more because they are squared in the average. A locus with a negative contrast still contributes positively to the overall contrast strength; it reverses both individuals' deviations at that locus, so their cross-product remains negative.
Worked Example: Calculating Covariance From a Tiny Hypothetical Genotype Matrix
Suppose two individuals have observed dosages \((0,1,2)\) and \((2,1,0)\) at three loci. For this illustration only, center each locus by the mean dosage in these two individuals, and define the profile cross-product with divisor \(m=3\). This calculation describes these data; three loci are far too few to establish a stable population pattern.
The locus means are \((1,1,1)\), so the centered rows are \((-1,0,1)\) and \((1,0,-1)\). Their cross-products are \(-1,0,-1\), and the average is \(C_{12}=(-1+0-1)/3=-0.6667\) dosage-squared units.
The negative value says that the two observed centered profiles oppose one another across these loci. It does not establish that the individuals have different ancestry: with so few loci, genotype sampling noise can dominate. Also, because the centering reference here was estimated from these same two individuals, this number should not be confused with covariance centered on known population frequencies.
Assumptions, Diagnostics, and Alternatives
The derivation describes an ancestry-frequency signal under a specified mixture model. Its interpretation is strongest when allele dosages are correctly coded, ancestry-specific frequency differences are real, and technical artifacts do not create systematic differences among individuals. The conditional-independence argument for distinct individuals additionally assumes no residual genotype dependence from close relatedness. In practice, these conditions are approximations, not guarantees.
- Check allele and sample quality. Genotype coding errors, strand mismatches, sample swaps, and differential missingness can produce coherent-looking but artificial patterns.
- Check technical structure. If sequencing or genotyping batch is associated with sample ancestry, batch can contribute covariance. Earlier material on batch effects emphasizes that technical and biological patterns can be confounded rather than separable from the data alone.
- Consider linkage disequilibrium. Nearby variants may carry redundant information. Treating many correlated loci as independent can make some genomic regions dominate the covariance summary.
- Inspect scaling and frequency choices. Centering removes a locus's reference mean; scaling changes the relative influence of loci. Rare variants can receive large weight under some scaling choices, while common variants may dominate unscaled dosage covariance.
- Account for relatedness and sampling. Close relatives share genotypes beyond what broad ancestry proportions predict. A small or unrepresentative sample may also make the reference frequency a poor description of the intended population.
Covariance is not the only way to describe structure. Direct allele-frequency comparisons between groups are easier to interpret at named loci but require group labels and do not automatically summarize many dimensions. Pairwise genetic distances offer an individual-level dissimilarity measure, but do not by themselves identify which allele-frequency contrasts drive that dissimilarity. Covariance aggregates signed deviations across loci, preserving whether profiles tend to move together or oppositely. Its compactness is useful, but its interpretation depends on the chosen loci, centering, scaling, and sample.
A common mistake is to say, “negative covariance proves these people come from different populations.” The calculation only says their centered dosage profiles tend to point in opposite directions relative to the chosen reference. A continuous ancestry gradient, imperfect reference frequencies, technical artifacts, or sampling variation can all generate or alter that pattern. Covariance is evidence about shared variation in the data, not a direct label for an individual's ancestry or proof of a causal account.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- In the two-group model, what happens to the ancestry-driven covariance if the two groups have the same allele frequency at every analyzed locus?
- With \(\bar q=0.40\), are individuals with \(q_i=0.60\) and \(q_\ell=0.80\) expected to have positive or negative ancestry-profile covariance, assuming at least one nonzero frequency contrast?
- Why does the cross-individual covariance derivation require a conditional-independence assumption when relating observed genotype products to expected profiles?
- Give one reason that a strong observed covariance pattern might not be caused by broad ancestry differences.
Solutions. (1) It is zero: every \(\delta_j=0\), so the average squared contrast in the covariance formula is zero. (2) Positive, because both ancestry deviations from the reference are positive and the average squared contrast is positive. (3) Conditional independence makes the expected product of the two individuals' centered genotype residuals zero, leaving the product of their expected centered dosages. Without it, shared residual dependence, such as relatedness, can add covariance. (4) A technical batch effect associated with samples, close relatedness, differential missingness, or a small number of influential linked loci could create or distort the pattern.