The Price Equation and Evolutionary Epidemiology
Evolution by natural selection is, at bottom, bookkeeping: the mean of a trait changes because some variants leave more descendants than others, and because descendants need not resemble their ancestors exactly. The Price equation is the exact statement of that bookkeeping. It is not a model of any particular system — it assumes almost nothing — yet it cleanly separates the part of trait change due to selection from the part due to transmission, and it is the natural language for asking how a pathogen’s virulence or transmissibility evolves while its epidemic unfolds.
The identity
Consider a population of ancestral entities indexed by — hosts, cells, lineages, or infections. Each carries a value of some trait, and each leaves descendants; we call its fitness. The descendants of ancestor carry, on average, the trait value , where is the average shift between an ancestor and its own descendants (from mutation, say, or measurement of a different life stage). Write for the ancestral mean trait and for the mean fitness.
The mean trait in the descendant generation is the fitness-weighted average of the descendant trait values, Multiplying through by and subtracting gives, with no approximation, where the covariance and expectation are taken over the ancestral population with equal weight on each individual. This is the Price equation (Price 1970; Price 1972).
The two terms are the whole story. The selection term is the covariance between fitness and trait: if individuals with a larger tend to leave more descendants, the covariance is positive and the mean trait increases. The transmission term (also called the transmission-bias or fidelity term) is the fitness-weighted average of the ancestor-to-descendant change: if descendants systematically differ from their parents — directional mutation, imperfect inheritance — the mean shifts even without any selection. Set every (perfect transmission) and only selection remains; make fitness independent of the trait and only transmission remains.
The Price equation is an identity, not a mechanism. It holds for any mapping of ancestors to descendants, with any definition of the trait, in any population — which is exactly why it is a useful accounting frame rather than a predictive model on its own. Its power comes from the interpretation of the two terms and from choosing and so those terms mean something (Frank 2012).
It is exact — check it
Because the identity is exact, a few lines of code reproduce it to machine precision on any toy population. We take eight lineages with hand-chosen traits, descendant counts, and a small transmission bias, and confirm that equals .
import numpy as np
z = np.array([2.0, 2.5, 3.0, 3.0, 3.5, 4.0, 4.5, 5.0]) # ancestor trait
w = np.array([1, 2, 1, 3, 3, 4, 4, 5]) # number of descendants (fitness)
dz = np.full(z.size, -0.12) # transmission bias (mutation)
wbar, zbar = w.mean(), z.mean()
zbar_prime = (w * (z + dz)).sum() / w.sum() # fitness-weighted descendant mean
cov = ((w - wbar) * (z - zbar)).mean() # selection term
tran = (w * dz).mean() # transmission term
print("Cov(w,z) =", round(cov, 6))
print("E(w*dz) =", round(tran, 6))
print("sum =", round(cov + tran, 6))
print("wbar*dzbar =", round(wbar * (zbar_prime - zbar), 6))
Cov(w,z) = 1.179688
E(w*dz) = -0.345
sum = 0.834688
wbar*dzbar = 0.834687
The two sides agree exactly: the covariance and the transmission bias together are the change in the mean.
The selection term connects to the breeder’s equation
The first term is the same selection that the breeder’s equation describes, seen from a different angle. Dividing by and dropping transmission, the change in the mean is — the covariance of the trait with relative fitness. Writing relative fitness as a regression on the trait turns this into a response equal to a selection differential times a heritability-like slope, which is precisely once is a breeding value. The Price equation is thus the assumption-light parent of the breeder’s equation: the breeder’s equation is what you get when you model the covariance as a linear regression of fitness on an additively heritable trait.
The transmission term, meanwhile, is where nonlinear averaging lives. Whenever descendants map to ancestors through a curved relationship, the mean of the transformed trait is not the transform of the mean, and the gap is governed by Jensen’s inequality — the same convexity correction that drives the inflationary effect on the metapopulation asynchrony page.
A continuous-time Price equation
Textbook derivations, like the one above, are discrete-time with non-overlapping generations: a clean census of ancestors, then a clean census of descendants. Epidemics do not work that way. Infections are born (through transmission) and die (through recovery or host death) continuously, generations overlap, and the population turns over while we watch. Day, Parsons, Lambert & Gandon (2020) derive the version of Price’s equation that fits this world, and it partitions change into three terms rather than two.
Let be the number of individuals of type , each with trait , and let the mean be taken over the frequencies . In a short interval , a type- individual produces descendants (birth rate ) and survives with probability (death rate ); its net reproductive rate is . Descendants may be of a different type, so the average trait among the offspring of a type- parent is ; and an individual that survives may itself change type, at trait-rate . Carrying the census forward by and taking the limit gives their equation (2.4),
The first two terms are the continuous-time echoes of the discrete identity: selection is now the covariance between trait and net reproductive rate, and transmission is the birth-weighted mutation bias. The third term is genuinely new to the overlapping-generations setting: it accounts for individuals that persist but change — a trait that drifts over an individual’s lifetime, or an infection whose strain composition is rewritten from within.
A detail that becomes the crux of the epidemiology: the selection term is driven by both births and deaths (it uses the net rate ), the transmission term is driven by births only (mutation happens when a new individual is made, ), and the within-individual term involves neither — it reshuffles types among individuals who are already alive.
The three terms as epidemiology
Now read the three terms for a pathogen. Following Day et al. (2020), take a two-strain compartment model in which hosts are infected with strain , susceptibles are infected at strain-specific transmission rate , infections end (host death or clearance) at rate where is the virulence, transmission mutates to the other strain with probability , and secondary infection lets one strain displace another within a host (superinfection, rate ). The birth and death rates of Price’s equation are then and the change in the mean trait — here we track the population’s mean virulence — becomes their equation (4.15),
Each term now names a distinct piece of pathogen biology.
- Selection — — is between-host competition: strains differ in the net rate at which their infections spread, births minus deaths , and the covariance of that net rate with virulence sets whether mean virulence is pushed up or down.
- Transmission — — is mutation during transmission: it involves the birth rate but not the death rate, because a strain’s identity can only change when it makes a new infection.
- Within-host change — — is within-host competition: existing infections switch strain through secondary infection, involving neither births nor deaths, only the reshuffling of who carries what.
The figure simulates this two-strain model on a transmission-virulence trade-off (, so the more transmissible strain is also the more virulent) and reads off all three terms as the epidemic runs.
Eco-evolutionary feedback
Notice that every term contains or : selection through , transmission through , within-host change through the density of co-circulating infections. The evolutionary equation is therefore coupled to the epidemiological equations for and — as the epidemic depletes susceptibles, it changes the very selection pressures acting on the pathogen, and the pathogen’s evolution feeds back on the epidemic’s course. This epi-evolutionary feedback is the feature that traditional applications of Price’s equation, with no explicit demography, simply do not have. Casting the model in Price’s form is what makes the feedback visible: it separates the direct action of selection from the indirect action of the changing host population, and it lets the two play out on comparable timescales instead of assuming evolution is infinitely slow.
Transient evolution can oppose long-term evolution
Panel D makes the feedback concrete. The strains differ in net rate by a quantity that depends on the susceptible density . Early in an epidemic is large, the transmission advantage dominates, and selection favours the more transmissible — hence more virulent — strain: mean virulence climbs to a transient peak. As the epidemic burns through susceptibles, falls; once it drops below the sign flips, the shorter infectious period of the virulent strain becomes decisive, and the milder strain wins the long-term, endemic competition. The short-term direction of evolution is opposite to the long-term one — which is why emerging epidemics can select for high virulence that later recedes (Berngruber et al. 2013), why epidemic and endemic diseases differ in their evolutionary optima, and why the immediate and eventual evolutionary consequences of an intervention like vaccination can point in opposite directions (Gandon & Day 2007).
Demographic stochasticity reweights the terms
In a small infected population the deterministic equations above are not the whole story: births and deaths are discrete, random events, and this demographic stochasticity alters selection itself. Day et al. (2020) show that the same three-term partition is the natural way to bookkeep that effect. Writing for the number of infected hosts (habitat area times infected density ), their equation (5.2) multiplies the birth part of selection by and the death part by ,
The intuition is that evolution is a change in frequency. When a birth occurs the number of infections rises from to , so each new infection moves the frequency by a little less; when a death occurs the number falls to , so each loss moves the frequency by a little more. Births are therefore down-weighted and deaths up-weighted, and — because the within-host term changes no totals — it is untouched.
Combining the two selection pieces exposes a classic result. The effective “measure of fitness” in the covariance is which is expected fitness minus a penalty proportional to — the rate at which birth-or-death events happen, i.e. the variance in fitness for a birth-death process. Selection under drift favours high expected fitness and low variance in fitness, recovering the long-standing principle that demographic stochasticity selects for reduced variance in offspring number (Gillespie 1974; Parsons, Lambert, Day & Gandon 2018).
For a pathogen the asymmetry has teeth. Transmission is a birth rate and virulence acts through a death rate, so demographic stochasticity weakens selection on transmission and strengthens selection on virulence. Along a transmission-virulence trade-off — where a strain buys higher transmission by paying higher virulence — the penalty on transmission and the premium on avoiding a high death rate both push the same way: toward lower virulence (Parsons et al. 2018). The right panel makes this vivid by pitting two strains that are deterministically neutral — engineered to have identical net fitness — against each other; the milder strain has the smaller , and drift alone tips the balance in its favour, more strongly the smaller the infected population.
In code
The continuous-time identity is worth verifying the way we verified the discrete one: simulate the two-strain epidemic, compute the three terms from their definitions, and check that they reconstruct .
Python
We integrate the Day et al. two-strain model and compare the sum of the selection, mutation, and within-host terms against the exact time derivative of mean virulence.
import numpy as np
from scipy.integrate import solve_ivp
mu, a = 0.02, 6.0
v1, v2 = 0.80, 0.40 # virulence of the two strains
b1r, b2r = a*np.sqrt(v1), a*np.sqrt(v2) # transmission via the trade-off beta = a*sqrt(v)
tau, sig = 0.01, 0.6 # mutation prob on transmission; superinfection rate
rho12, rho21 = 1.0, 0.0 # the more virulent strain wins within-host
def h(I1, I2):
return (b1r*I1*(1-tau) + b2r*I2*tau, b2r*I2*(1-tau) + b1r*I1*tau)
def rhs(t, y):
S, I1, I2 = y
h1, h2 = h(I1, I2)
dS = mu*(1-S) - (b1r*I1 + b2r*I2)*S
dI1 = h1*S - (mu+v1)*I1 + sig*h1*I2*rho12 - sig*h2*I1*rho21
dI2 = h2*S - (mu+v2)*I2 + sig*h2*I1*rho21 - sig*h1*I2*rho12
return [dS, dI1, dI2]
sol = solve_ivp(rhs, (0, 300), [0.99, 5e-3, 5e-3], t_eval=np.linspace(0, 300, 6000),
rtol=1e-10, atol=1e-13, method="LSODA")
S, I1, I2 = sol.y
p = I1/(I1+I2) # frequency of strain 1
b1, b2 = b1r*S, b2r*S
r1, r2 = b1-(mu+v1), b2-(mu+v2)
h1, h2 = h(I1, I2)
sel = p*(1-p)*(v1-v2)*(r1-r2) # cov[v, r]
mut = p*b1*tau*(v2-v1) + (1-p)*b2*tau*(v1-v2) # E[b*dv]
wh = (v1-v2)*(sig*h1*(1-p)*rho12 - sig*h2*p*rho21) # E[dv^s/dt]
# exact dp/dt from the ODE, hence exact dvbar/dt = (v1-v2)*dp/dt
dI1, dI2 = np.gradient(I1, sol.t), np.gradient(I2, sol.t)
dp = (dI1*(I1+I2) - I1*(dI1+dI2)) / (I1+I2)**2
dvbar = (v1-v2)*dp
m = (sol.t > 2) & (sol.t < 298)
print("max |sum of 3 terms - dvbar/dt| :", float(np.max(np.abs((sel+mut+wh-dvbar)[m]))))
print("transient peak mean virulence :", round(float((p*v1+(1-p)*v2).max()), 3))
print("endemic mean virulence :", round(float((p*v1+(1-p)*v2)[-1]), 3), "(v2 =", v2, ")")
max |sum of 3 terms - dvbar/dt| : 6.775067564504869e-05
transient peak mean virulence : 0.79
endemic mean virulence : 0.421 (v2 = 0.4 )
The three terms sum to the derivative to within finite-difference error, mean virulence peaks transiently well above its endemic value, and the milder strain inherits the long run.
R
# Discrete Price identity: Cov(w, z) + E(w * dz) = wbar * dzbar
z <- c(2.0, 2.5, 3.0, 3.0, 3.5, 4.0, 4.5, 5.0) # ancestor trait
w <- c(1, 2, 1, 3, 3, 4, 4, 5) # descendants (fitness)
dz <- rep(-0.12, length(z)) # transmission bias
wbar <- mean(w); zbar <- mean(z)
zbar_prime <- sum(w * (z + dz)) / sum(w)
cov <- mean((w - wbar) * (z - zbar)) # selection
tran <- mean(w * dz) # transmission
c(sum = cov + tran, wbar_dzbar = wbar * (zbar_prime - zbar))
Julia
using Statistics
# Discrete Price identity on a small population
z = [2.0, 2.5, 3.0, 3.0, 3.5, 4.0, 4.5, 5.0] # ancestor trait
w = [1.0, 2, 1, 3, 3, 4, 4, 5] # descendants (fitness)
dz = fill(-0.12, length(z)) # transmission bias
wbar, zbar = mean(w), mean(z)
zbar_prime = sum(w .* (z .+ dz)) / sum(w)
covwz = mean((w .- wbar) .* (z .- zbar)) # selection
tran = mean(w .* dz) # transmission
(sum = covwz + tran, wbar_dzbar = wbar * (zbar_prime - zbar))
Why it matters
The Price equation is the closest thing evolutionary biology has to a conservation law: an exact identity that holds for any population and any trait, and that splits change into selection plus transmission by pure bookkeeping. Its continuous-time form is what lets that bookkeeping reach the overlapping generations of an epidemic, where it adds a third, within-host term and — crucially — couples the evolutionary equation to the demography of susceptibles and infecteds. That coupling is where the epidemiological payoff lives: it explains why virulence can spike in an emerging epidemic and relax in an endemic one, why interventions can have opposite short- and long-term evolutionary effects, and why small, stochastic pathogen populations should drift toward lower virulence. Read this way, Price’s equation is less a formula to solve than a lens for seeing which force — between-host spread, mutation, within-host competition, or the shifting host population itself — is moving a pathogen at any moment.
Related
- Quantitative Genetics and the Breeder’s Equation — the regression form of the selection term
- Jensen’s Inequality and Nonlinear Averaging — the convexity behind the transmission term
- Adaptive Dynamics and the Evolution of Virulence — the trade-off that sets the direction of selection
- Genetic Drift and the Wright–Fisher Model — fitness variance and small populations
- Selection and Mutation–Selection Balance
- The Next-Generation Matrix and R₀
- Asynchrony and the Inflationary Effect in Metapopulations — the same covariance decomposition, in space
- Compartmental Models (SIR)
- Quantitative Methods