Host density and endemic disease

ecology tutorial
R
disease ecology
population models
theoretical ecology
Endemic disease in R: why density-dependent transmission gives a host-density threshold for invasion, and how a pathogen settles to an endemic prevalence.
Author

Tidy Ecology

Published

2026-08-03

The SIR model treats one closed outbreak, but most wildlife diseases are not one-off events; they smoulder, persist, and flare again as new susceptibles are born. Whether a pathogen can establish and persist at all often depends on something the basic model hides inside its transmission term: how many hosts there are. For many diseases there is a threshold host density below which the pathogen simply cannot invade, and that single fact shapes how disease regulates wildlife and whether culling can ever clear it.

Transmission that scales with density

When infection spreads through direct contact, the rate at which a susceptible meets an infected host rises with how crowded the population is. In a denser population there are more contacts per unit time, so the transmission term scales with host density rather than being fixed. That makes the reproduction number itself depend on density: it is the per-contact transmission times host density, divided by the recovery rate.

b <- 0.002; gamma <- 0.1             # b = transmission per host per contact
R0_dens <- function(N) b*N/gamma     # reproduction number rises with density
c(N30 = R0_dens(30), N50 = R0_dens(50), N80 = R0_dens(80))
N30 N50 N80 
0.6 1.0 1.6 

At low density the reproduction number sits below one and the pathogen cannot spread; at high density it clears one and an epidemic becomes possible. The density where it crosses one is the threshold host density, the transmission-and-recovery combination that makes each case exactly replace itself.

N_T <- gamma/b                       # host-density threshold: R0 = 1
N_T
[1] 50

The threshold density here is 50 hosts. Below it the pathogen fades out no matter how it is introduced; above it the disease can invade and the reproduction number keeps climbing with density. This is the classic result that gives disease a role in ecology it would not otherwise have: a pathogen with density-dependent transmission can only persist where its host is common enough, so it tends to knock the host back toward that threshold and hold it there rather than driving it extinct.

Ng <- seq(0, 120, 1)
dg <- data.frame(N = Ng, R0 = R0_dens(Ng))
ggplot(dg, aes(N, R0)) +
  geom_hline(yintercept = 1, colour = col_ref, linetype = "dotted") +
  geom_vline(xintercept = N_T, colour = col_ref, linetype = "dotted") +
  geom_line(colour = col_a, linewidth = 1) +
  annotate("text", x = N_T + 2, y = 0.4, label = "threshold density", hjust = 0, colour = col_ref, size = 3.4) +
  labs(x = "Host density", y = "Basic reproduction number",
       title = "A pathogen needs its host common enough to invade")
A rising straight line of reproduction number against host density crossing a horizontal line at one, at the threshold density marked with a dotted vertical line.
Figure 1: The reproduction number against host density under density-dependent transmission. Below the threshold density (dotted) the pathogen cannot invade; above it the disease spreads and the reproduction number keeps rising.

Settling to an endemic level

Above the threshold, a pathogen that hosts can catch more than once does not burn out; it settles to a steady prevalence where new infections exactly balance recoveries. In the simplest such model, where recovered hosts become susceptible again, that endemic prevalence is one minus one over the reproduction number, the same expression as the herd immunity threshold, now describing where the disease sits rather than where it stops.

sis <- function(R0, I0 = 1e-3, Tn = 300, dt = 0.05) {
  I <- I0
  for (k in 1:(Tn/dt)) I <- I + (R0*gamma*(1 - I)*I - gamma*I)*dt   # susceptibles = 1 - I
  I
}
c(R0_4_endemic = sis(4), analytic = 1 - 1/4, R0_0.8 = sis(0.8))
R0_4_endemic     analytic       R0_0.8 
7.500000e-01 7.500000e-01 2.461491e-06 

With a reproduction number of 4 the disease settles at a prevalence of 0.75, exactly one minus one over the reproduction number, and stays there indefinitely: an endemic infection. Drop the reproduction number below one, whether by thinning the host population below the threshold density or by any other route, and the prevalence falls to zero and the pathogen is gone. The endemic level is reached by a smooth, saturating climb, fast while susceptibles are plentiful and slowing as the prevalence nears its ceiling.

traj <- function(R0) { I <- 1e-3; d <- data.frame(t = 0, I = I)
  for (k in 1:4000) { I <- I + (R0*gamma*(1 - I)*I - gamma*I)*0.05; if (k %% 20 == 0) d <- rbind(d, data.frame(t = k*0.05, I = I)) }; d }
dd <- rbind(cbind(traj(4), case = "R0 = 4 (endemic)"), cbind(traj(0.8), case = "R0 = 0.8 (fades out)"))
ggplot(dd, aes(t, I, colour = case)) +
  geom_hline(yintercept = endemic(4), colour = col_ref, linetype = "dotted") +
  geom_line(linewidth = 1) +
  scale_colour_manual(values = c("R0 = 4 (endemic)" = col_a, "R0 = 0.8 (fades out)" = col_b)) +
  labs(x = "Time (days)", y = "Prevalence", colour = NULL,
       title = "Above the threshold the disease persists, below it clears")
Two prevalence curves over time; one rises and levels off at a positive endemic value, the other decays to zero.
Figure 2: Prevalence over time for a persistent infection. Above the threshold (green) it climbs to a steady endemic level, one minus one over the reproduction number; below it (ochre) the pathogen dies out.

The threshold is a modelling choice, not a fact

The host-density threshold is one of the most useful ideas in disease ecology and one of the most fragile, because it depends entirely on transmission scaling with density. That assumption is right for many directly transmitted diseases but wrong for others: sexually transmitted and some vector-borne pathogens spread at a rate set by the frequency of infecteds, not their density, and those have no host-density threshold at all and cannot be controlled by thinning the population. Which form transmission takes is the single most consequential choice in a wildlife disease model, it decides whether culling helps or is useless, and it is rarely settled by the data. That choice, and the other assumptions that quietly set the answer, are the checking post.

References

  • Anderson RM, May RM 1979. Nature 280(5721):361-367 (10.1038/280361a0).
  • Lloyd-Smith JO, Cross PC, Briggs CJ, Daszak P, Getz WM et al. 2005. Trends in Ecology and Evolution 20(9):511-519 (10.1016/j.tree.2005.07.004).

Newsletter

Get new tutorials by email

New R and QGIS tutorials for ecologists, straight to your inbox. No spam; unsubscribe anytime.

By subscribing you agree to receive these emails and confirm your address once. See the privacy policy.