Input matching and undermatching

ecology tutorial
R
foraging
behaviour
habitat selection
Testing the ideal free distribution in R: the matching slope, why real animals undermatch and under-use the best patches, and what the slope reveals.
Author

Tidy Ecology

Published

2026-08-01

The ideal free distribution predicts input matching: the number of foragers in a patch should be proportional to its resource supply. That is a testable line, and testing it turns the whole theory into a single number, the matching slope. What that number keeps coming out to is one of the most consistent results in behavioural ecology, and it is not one.

The matching slope

Proportionality is a straight line through the origin, which on logarithmic axes becomes a line of slope one. So plot the log of the number of foragers in each patch against the log of its resource input, fit a line, and read the slope. A slope of one is perfect matching. A slope below one is undermatching: the rich patches hold fewer foragers than proportionality demands, and the poor patches hold more. A slope above one is overmatching, and is rare.

Q <- c(40, 30, 20, 10); N <- 200
settle   <- function(s) as.numeric(rmultinom(1, N, Q^s / sum(Q^s)))  # s is discrimination
slope_of <- function(n) unname(coef(lm(log(n) ~ log(Q)))[2])
set.seed(412)
c(perfect_discrimination = slope_of(settle(1.0)), imperfect = slope_of(settle(0.5)))
perfect_discrimination              imperfect 
             1.2149351              0.2772556 

Here foragers settle in each patch with a probability that depends on the patch’s richness raised to a power s, a discrimination parameter: at s of one they weight patches exactly by richness, below one they blur the differences. Averaged over many realisations the matching slope comes out at 1.01 when discrimination is perfect and 0.52 when it is halved. The slope essentially reports how sharply the animals distinguish good patches from bad.

set.seed(7)
nm <- settle(1.0); nu <- settle(0.5)
dd <- rbind(data.frame(Q = Q, n = nm, kind = "matching (slope 1)"),
            data.frame(Q = Q, n = nu, kind = "undermatching (slope < 1)"))
ggplot(dd, aes(Q, n, colour = kind)) +
  geom_smooth(method = "lm", se = FALSE, linewidth = 0.9) +
  geom_point(size = 3) +
  scale_x_log10() + scale_y_log10() +
  scale_colour_manual(values = c("matching (slope 1)" = col_match, "undermatching (slope < 1)" = col_under)) +
  labs(x = "Resource input (log)", y = "Foragers (log)", colour = NULL,
       title = "Real distributions undermatch")
Log-log scatter of foragers against resources with a green matching line of slope one and a shallower ochre undermatching line, points below the matching line at high resource values.
Figure 1: Foragers against resources on log axes. Perfect matching lies on the slope-one line (green); real distributions typically fall below it (ochre), the best patches under-used and the poorest over-used.

Why animals undermatch

Across dozens of experiments, from sticklebacks to ducks to people, the matching slope lands below one far more often than on it (Kennedy and Gray 1993 Oikos 68(1):158-166). The consistency is the clue: something systematic pulls animals off perfect matching, and several mechanisms all pull the same way. Perceptual limits blur the difference between a good and a slightly better patch. Incomplete information means animals sample and lag rather than settling instantly. Travel and switching costs make it not worth chasing a small advantage. And competitors are rarely equal, so a few dominant individuals monopolise the best patch and the rest give up on it sooner than matching would predict (Sutherland 1983 Journal of Animal Ecology 52(3):821-828). Every one of these leaves the best patch under-used.

ss <- seq(0.2, 1.2, 0.1)
ds <- data.frame(s = ss, slope = sapply(ss, avg_slope))
ggplot(ds, aes(s, slope)) +
  geom_hline(yintercept = 1, colour = col_ref, linetype = "dashed") +
  geom_line(colour = col_under, linewidth = 1) +
  labs(x = "Discrimination between patches", y = "Matching slope",
       title = "Weaker discrimination means stronger undermatching")
A rising line of matching slope against a discrimination parameter, passing through slope one at perfect discrimination and falling below one as discrimination weakens.
Figure 2: The matching slope against how sharply foragers discriminate between patches. Perfect discrimination gives a slope of one; blurring the differences drives the slope down into undermatching.

What the slope does not tell you

The matching slope is a good summary and a poor diagnosis. A slope of one half is compatible with foragers that cannot see the difference between patches, with dominants hogging the rich patch while subordinates settle for less, with heavy interference, and with animals that simply have not finished redistributing. The number is the same; the biology is not. So a departure from matching is a starting point, not a conclusion: it says the ideal free assumptions are relaxed somewhere, and identifying where takes more than the slope. That the theory’s own null is so rarely met, yet so useful as a baseline, is the tension the checking post works through. First, though, the next post changes what is being equalised, from instantaneous intake to fitness, and recovers a sharper tool.

References

  • Kennedy M, Gray RD 1993. Oikos 68(1):158-166 (10.2307/3545322).
  • Sutherland WJ 1983. Journal of Animal Ecology 52(3):821-828 (10.2307/4456).

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.