Population models in R

Matrix population models, integral projection models and integrated models in R from scratch: growth rate, elasticity, transients, and what lambda cannot tell you.

The idea is old and still remarkable: write down how likely an individual is to survive, to grow and to reproduce, arrange those numbers in a matrix, and the dominant eigenvalue tells you whether the population grows. Nothing about a projection matrix is statistical. It is bookkeeping made precise, and its power comes from the fact that it forces you to say exactly what you believe about every stage of the life cycle.

This page collects every demographic modelling tutorial on this site: matrices, their continuous successor, and the models that join demographic data to counts. All of them are built by hand in base R.

What lambda is, and what it is not

The dominant eigenvalue is an asymptotic property of a matrix, not a forecast for a population. It says what the growth rate would settle to if the matrix stayed fixed forever and the population reached its stable structure. Real populations do neither. That is not an objection to the method, it is the method’s contract, and the interesting work is in what happens when you read the contract carefully.

Two consequences that matter in practice. First, transients: a population that is not at its stable structure can grow or shrink for years in the opposite direction to lambda, purely from its starting composition, and a management report that quotes lambda alone has said nothing about the next decade. Second, variance: environmental variation does not average out. The long-run stochastic growth rate sits below the growth rate of the mean matrix, and the gap widens with the variance, which is why a mean-matrix answer is systematically optimistic.

Which rate should you act on?

This is the question the matrix answers best. Sensitivity says how much lambda moves when an element moves by an absolute amount, elasticity says the same in proportional terms, and the two rank vital rates differently. The trap is a specific one and it recurs: the vital rate that DIFFERS most between two populations is not the rate that CONTRIBUTES most to the difference in their growth. A retrospective decomposition answers the second question, and it is the second question that management wants.

Age, stage, size, and a name collision

Age works when age determines fate. For a plant, a coral or a fish it usually does not: a small twenty-year-old and a large five-year-old have the same future, so the classification should be stage or size. Push that to the limit and the classes vanish: an integral projection model replaces the matrix with a kernel built from regressions, and the arithmetic goes on unchanged. It brings two numerical traps of its own, eviction and mesh, which are discretisation artefacts rather than biology and which bias the growth rate quietly.

One warning about the literature, because this page links to both: IPM means two different things. An integral projection model is the continuous-size matrix. An integrated population model is a joint likelihood over counts, capture-recapture and productivity data. They share an abbreviation and nothing else.

The data problem

A run of counts cannot separate survival from recruitment. The likelihood is flat along that ridge, and no cleverness in the model recovers what the data never contained. Integrated models solve it by adding the data that carries the missing information, and they do something slightly uncanny in the process: they will report an estimate for a parameter you have no direct data on at all, borrowed through the joint structure. That is real information, and it is also where an integrated model can hide a conflict between its data sources behind a plausible answer.

The tutorials

From vital rates to a growth rate

What the matrix is for

When the environment varies

Continuous size: the integral projection model

Joining the data sources

Where this connects

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.