← Guides Frequency-Dependent

Core 12 min read Open the module

Selection when rare is fit

A cost that grows with a genotype's own frequency can hold two alleles together without heterozygote advantage.

Read first: Natural selection at one locus

Fitness that depends on frequency

In the Natural Selection module each genotype has a fixed fitness. Here fitness changes with how common the genotype is. Each genotype pays a cost proportional to its own frequency. That is negative frequency dependence: being rare is an advantage.

It happens in nature. Crowded individuals compete for the same food. Parasites adapt to the commonest host type. With q = 1 − p, the module writes the three fitnesses as wAA = 1 − s1·p², wAa = 1 − s2·2pq and waa = 1 − s3·q². The terms p², 2pq and q² are the Hardy-Weinberg frequencies of the genotypes, and s1, s2 and s3 are the cost coefficients.

The defaults are s1 = 0.3, s2 = 0.1 and s3 = 0.3. The module does not follow a population through time. It evaluates one generation of selection at every allele frequency from p = 0 to 1 in steps of 0.01, which is 101 points. There is no drift, mutation or migration, so the same costs always give the same curves.

Fitness across allele frequencies

Figure 1. Fitness of AA, Aa and aa, and mean fitness, against p. At p = 0.2 the rare homozygote AA has fitness 0.988 and the common aa has 0.808. At p = 0.5 AA and aa both have 0.925, Aa has 0.95 and the mean is 0.9375. The mean falls to 0.7 at p = 0 and p = 1, where only one homozygote is left and it pays its full cost of 0.3.

From fitness to the change in p

The recursion is the one from constant selection. The mean fitness is w̄ = p²·wAA + 2pq·wAa + q²·waa, the next frequency is p′ = (p²·wAA + pq·wAa) / w̄, and the change is Δp = p′ − p. The only difference is that wAA, wAa and waa are recomputed at each p.

A worked case at p = 0.2. The fitnesses are 0.988, 0.968 and 0.808, and w̄ = 0.866. Then p′ = (0.04 × 0.988 + 0.16 × 0.968) / 0.866 = 0.2244, so Δp = +0.0244. A is rare, its carriers are the fitter ones, and A rises.

An equilibrium is a frequency where Δp = 0. If Δp is positive just below it and negative just above it, the equilibrium is stable: a small push is undone. If the signs are the other way round, it is unstable. The module does not compute equilibria. You read them from where the Δp curve crosses zero.

Compare this with constant selection. There, a stable mix of two alleles needs a heterozygote fitter than both homozygotes. Here the mix comes from the rare-type advantage alone.

A stable balance at 0.5

Figure 2. Δp against p for the defaults. It is positive below 0.5, zero at 0.5 and negative above. The largest gain is +0.0252 at p = 0.16. Because s1 = s3, the curve is symmetric: Δp is +0.0244 at p = 0.2 and −0.0244 at p = 0.8.

No heterozygote advantage needed

Figure 3. All three costs are 0.3. At p = 0.5 the heterozygote has fitness 0.85, below both homozygotes at 0.925. Δp still crosses zero at 0.5, from positive to negative, so the balance is stable. The largest gain falls to +0.0204.

Exercise

Make the costs unequal

Set s₁ to 0.5, s₂ to 0.1 and s₃ to 0.2, then run. Look at where the Δp curve crosses zero.

What to expect. The curve crosses zero between p = 0.40 and 0.41, where Δp goes from +0.0004 to −0.0005. AA pays the larger cost, so A is held below one half. At p = 0.5 Δp is −0.0101, which pushes A back down toward 0.40.

Open the walkthrough step →

Exercise

Find three equilibria

Set s₁ to 0.3, s₂ to 0.5 and s₃ to 0.3, then run. Count the zero crossings, and note the sign of Δp on each side of each one.

What to expect. Δp crosses zero three times. The crossings between 0.36 and 0.37 and between 0.63 and 0.64 are stable. The one at 0.5 is unstable, because Δp is negative just below it and positive just above. A heterozygote that pays a large cost splits the population toward one side or the other. The values are small, at most 0.0167.

Open the walkthrough step →

Summary

  • Each genotype pays a cost proportional to its own frequency: wAA = 1 − s1·p², wAa = 1 − s2·2pq, waa = 1 − s3·q².
  • Rare-type advantage can hold both alleles even when the heterozygote is not the fittest genotype.
  • The module computes Δp = p′ − p at 101 values of p. It does not run a time series.
  • Δp crossing zero from positive to negative is a stable equilibrium; negative to positive is unstable.
  • With the defaults the stable equilibrium is p = 0.5, and a heterozygote with fitness 0.85 against 0.925 for the homozygotes does not remove it.
  • Unequal costs move the equilibrium: s1 = 0.5, s2 = 0.1, s3 = 0.2 puts it near 0.40.
  • A large heterozygote cost (s2 = 0.5) gives two stable equilibria, at about 0.365 and 0.635, with an unstable one at 0.5 between them.