popdemo: an R package for population demography using projection matrix analysis


  • Iain Stott,

    1. Centre for Ecology and Conservation, Biosciences, College of Life and Environmental Sciences, University of Exeter Cornwall Campus, Tremough, Treliever Road, Penryn, Cornwall TR10 9EZ, UK
    Search for more papers by this author
  • David J. Hodgson,

    Corresponding author
    1. Centre for Ecology and Conservation, Biosciences, College of Life and Environmental Sciences, University of Exeter Cornwall Campus, Tremough, Treliever Road, Penryn, Cornwall TR10 9EZ, UK
      Correspondence author. E-mail: d.j.hodgson@exeter.ac.uk
    Search for more papers by this author
  • Stuart Townley

    1. Environment and Sustainability Institute, University of Exeter Cornwall Campus, Tremough, Treliever Road, Penryn, Cornwall TR10 9EZ, UK
    Search for more papers by this author

Correspondence author. E-mail: d.j.hodgson@exeter.ac.uk


1. Effective population management requires accurate predictions of future population dynamics and how they may be manipulated to achieve management goals.

2. The R package popdemo provides software tools for novel analytical methods that aim to enhance the predictive power of basic population projection matrix models. These include indices of transient population dynamics and transfer function analyses.

3. We use a case study to demonstrate the use and importance of these methods for population management and briefly discuss their potential application outside population ecology.


popdemo is an R package (available at http://cran.R-project.org) that provides novel analytical methods for basic population projection matrix (PPM) models. These add to the more traditional approaches available in the package popbio (Stubben & Milligan 2007). In this study, we highlight key methods covered by popdemo and use a PPM case study to show how these may be used for population management. For detailed information, we point the reader in the direction of package demos that provide comprehensive coverage of functionality. Finally, we discuss how the tools in this package could find use outside population ecology.

Population projection matrix models

Population projection matrix models are an important tool in ecological and evolutionary demography, for population management (Kareiva, Marvier & McClure 2000), comparative ecology (Buckley et al. 2010) and life history theory (Åberg et al. 2009). Many studies rely on basic density-independent, nonstochastic (linear, time-invariant) PPM models (e.g. Linkie et al. 2007), as data required by more complex density-dependent and stochastic models (e.g. Jensen 1996; Fieberg & Ellner 2001) are often difficult to provide. Our examples use a PPM for medium-fecundity desert tortoise (Gopherus agassizii) with eight size classes (Doak, Kareiva & Klepetka 1994). Once popdemo is installed and loaded, the matrix is created by running data(Tort):


Basic PPM models take the form nt = Atn0, where A is the PPM describing the stage-structured life cycle of the organism, and n0 and nt are vectors containing numbers or densities of individuals in each stage class (the demographic structure) of the current population and the population at time t in the future, respectively (see Caswell 2001). Projecting and graphing population dynamics using this equation is often the first step towards understanding the model. popdemo’s function project enables this [Fig. 1; see demo(projection)]:

Figure 1.

 Population projection for the desert tortoise population projection matrix, generated using the project function (Appendix S1).

n0 <- c(1,1,2,3,5,8,13,21)

pr1 <- project(Tort, vector=n0, time=50)


Measuring population dynamics

Traditionally, analysis of basic PPM models has focussed on long-term (asymptotic) population dynamics. Assuming density-independence and a constant environment, any population is predicted to eventually settle to a stable state, with a stable demographic structure equal to the dominant right eigenvector w of the PPM, and a stable geometric growth rate equal to the dominant eigenvalue λmax of the PPM (Caswell 2001). The stable growth rate is often used as an indicator of population viability and fitness: λmax > 1 predicts long-term population increase, whereas λmax < 1 predicts long-term decline. The desert tortoise PPM declines in the long term, with λmax = 0·958 (Fig. 1; Appendix S1).

Model assumptions

Ideally, most PPMs should be primitive, like the desert tortoise PPM, with asymptotic dynamics conforming to the aforementioned description. In contrast, imprimitive PPMs exhibit periodic life cycle transitions (Otto & Day 2007), which cause cyclic long-term population dynamics rather than stable geometric growth. Imprimitive PPMs may also be reducible and nonergodic: such models can be decomposed into two or more parts, yielding several different potential long-term growth rates that depend on demographic structure (Stott et al. 2010a). Many analyses assume primitivity, irreducibility and/or ergodicity, so it is important to check these properties to ensure analyses are appropriate to the model. The functions is.matrix_primitive, is.matrix_irreducible and is.matrix_ergodic facilitate these checks [Appendix S1; see demo(matrixtools)].

Transient dynamics

Even if a model is primitive, analysing only long-term dynamics has significant drawbacks. Asymptotic analyses ignore transient dynamics of the population. Populations are frequently subject to environmental disturbances, so are rarely at stable state. Consequently, long-term growth rate is often a poor predictor of real-world population dynamics (Bierzychudek 1999). Short-term (transient) dynamics may differ drastically from long-term trends because of discrepancies between the current and stable demographic distributions. In the short term, populations may increase faster than their stable growth rate (amplify) if reproductive adults are overrepresented in the population (as is the case in Fig. 1). Alternatively, they may grow more slowly than their stable growth rate (attenuate) if immature juveniles are overrepresented.

popdemo includes functions to calculate three key pairs of indices that measure transient dynamics. Reactivity (reactivity) and first-timestep attenuation (firststepatt) represent immediate amplification/attenuation in the first timestep, respectively. Maximum amplification (maxamp) and maximum attenuation (maxatt) represent the largest/smallest possible amplification/attenuation, respectively (Townley & Hodgson 2008). Upper and lower inertia (inertia) represent fixed long-term amplification/attenuation, respectively (Koons, Holmes & Grand 2007). These indices are standardised to remove effects of asymptotic dynamics and to assume a total initial population density of 1, so they can be compared both amongst and within models where these may differ, thus offering advantages over analysing simulated dynamics (see Stott, Townley & Hodgson 2011). Each index therefore describes how much larger or smaller the nonstable population is at a certain point along the population projection, relative to the density of an equivalent population initiated at stable stage structure. Indices of amplification are >1, whilst indices of attenuation are <1, with the exact value of the index giving the magnitude of amplification or attenuation.

The desert tortoise population amplifies if adults are overrepresented:

n0.amp <- c(1,1,2,3,5,8,13,21)

reactivity(Tort, vector=n0.amp)

maxamp(Tort, vector=n0.amp)

inertia(Tort, vector=n0.amp)

This population amplifies (reactivity equals 2·6) and, because of this, settles to a density over four times that predicted by stable growth (inertia equals 4·1; Fig. 2a). As asymptotic analysis indicates population decline, basing management decisions on that alone could result in poor strategies that ignore the potential for transient population amplification.

Figure 2.

 Transient dynamics of the desert tortoise population projection matrix. Plots are generated using the project function (Appendix S1) and are standardised to remove asymptotic dynamics and to assume an initial overall density of 1. Transient indices and bounds are added to plots in red. (a) A population where adults are overrepresented amplifies: reactivity (inline image) = 2·63; maximum amplification (inline image) = 5·11; inertia (inline image) = 4·14, whilst a population where juveniles are overrepresented attenuates: first-timestep attenuation (inline image) = 0·92; maximum attenuation (inline image) = 0·84; inertia (inline image) = 0·91. (b) Transient bounds result from stage-biased population projections: reactivity (inline image) = 3·58; first-timestep attenuation (inline image) = 0·75; maximum amplification (inline image) = 6·83; maximum attenuation (inline image) = 0·12; upper inertia (inline image) = 5·12; lower inertia (inline image) = 0·20.

The population attenuates if juveniles are overrepresented:

n0.att <- c(21,13,8,5,3,2,1,1)

firststepatt(Tort, vector=n0.att)

maxatt(Tort, vector=n0.att)

inertia(Tort, vector=n0.att)

This population attenuates (first-timestep attenuation equals 0·92) and settles to a density below that predicted by stable growth (inertia equals 0·91; Fig. 2a). In this case, asymptotic analysis would underestimate the severity of short-term decline, so that management efforts may fail to achieve desired goals.

Transient dynamics depend strongly on population structure. If population structure is not known, then transient bounds inform on the potential range of transient dynamics (Townley & Hodgson 2008; Stott, Townley & Hodgson 2011). Transient bounds on indices of amplification represent the largest possible values that those indices may take, whilst bounds on indices of attenuation represent the smallest possible values that those indices may take. These extreme values of amplification and attenuation result from projections of stage-biased demographic vectors (Townley & Hodgson 2008). A stage-biased vector contains 100% of individuals in a single-stage class, and there is one stage-biased vector for each stage of the life cycle (Fig. 2b). For example, a 3 × 3 matrix has a set of stage-biased vectors [1 0 0]; [0 1 0]; [0 0 1]. When using the aforementioned functions for generating transient indices, the relevant transient bound is returned if a demographic vector is not specified:





inertia(Tort, bound= upper’)

inertia(Tort, bound=‘lower’)

For the desert tortoise, a bias towards the largest individuals results in amplification bounds, whilst a bias towards yearlings results in attenuation bounds (Fig. 2b). The population can grow to an absolute maximum of almost seven times its current size (maximum amplification bound equals 6·82) and an absolute minimum of 12% its current size (maximum attenuation bound equals 0·12; Fig. 2b). The information provided by these transient bounds therefore provides best- or worst-case scenarios.

There are further indices of transient density available in popdemo, and the functions described here have extra utilities [see demo(transient)]. popdemo also contains functions for transient indices that deal with model convergence [see demo(convergence) and Stott, Townley & Hodgson 2011 for a discussion on convergence indices].

Perturbation analyses

For population management, it is important to know how population dynamics may be changed to achieve management goals. Perturbation analyses assess how changes to vital rates of the life cycle such as survival, fecundity or growth affect population dynamics. A classical approach is to conduct sensitivity analysis of the stable growth rate (asymptotic sensitivity analysis). This provides a linear estimate of the effect of perturbations on long-term population growth (Caswell 2001). Asymptotic sensitivity analyses have been used to prioritise potential management practises (e.g. Ratsirarson, Silander & Richard 1996) and analyse prospective population dynamics under varying environmental conditions (e.g. Abe, Nakashizuka & Tanaka 1998). Asymptotic sensitivity analysis of the desert tortoise PPM suggests that promoting growth of young adults (element [8,7] of the matrix) is an efficient way to encourage long-term population growth (Appendix S1). This could perhaps be achieved through protection and/or supplementary feeding of those individuals. Sensitivity analyses for transient dynamics also exist and provide a linear estimate of the effect of perturbations on short-term population density or growth (e.g. Caswell 2007).

Transfer function analyses

The linear relationships described by sensitivity analysis are tangents to more complicated nonlinear functions (Fig. 3). Because of this, sensitivity analyses may poorly describe the effect of larger perturbations on population dynamics. Transfer function analyses can model the exact nonlinear relationship between a perturbation and resulting population dynamics and require no more information than sensitivity analyses.

Figure 3.

 Transfer functions generated by the tfa and inertia.tfa functions (Appendix S1). Perturbation affects element [8,7] of the desert tortoise population projection matrix. Sensitivity slopes are added to the plots in red. (a) Transfer function of asymptotic growth generated using tfa, showing the how perturbation magnitude (p) affects asymptotic population growth (lambda). (b) Transfer function of population inertia generated using inertia.tfa, showing how perturbation magnitude (p) affects population inertia.

The function tfa models the transfer function of asymptotic growth (Hodgson & Townley 2004), and inertia.tfa models the transfer function of population inertia, providing a good indication of the effect of perturbation on transient dynamics (Stott, Hodgson & Townley 2012). Three parameters are required for these functions: the PPM, a perturbation structure and a range of perturbation magnitude. The perturbation structure is given with two vectors: d picks out the rows to be perturbed, and e picks out the columns to be perturbed. For example, to perturb element [3,2] of a 3 × 3 matrix, input d=c(0,0,1) and e=c(0,1,0) into the functions. The perturbation magnitude is a range of values that specifies how much to change the vital rate(s) by, and is given by a variable called prange. inertia.tfa also needs to either be given the demographic structure with which to calculate inertia, or be instructed to calculate the upper or lower bound on inertia.

The transfer function relating asymptotic growth to growth rate of young adult tortoises (element [8,7]) is modelled using the following code:

tf1 <- tfa(Tort, d=c(0,0,0,0,0,0,0,1),       e=c(0,0,0,0,0,0,1,0),



Sensitivity analysis of asymptotic growth underestimates the effort needed to reverse long-term population decline (Fig. 3a): sensitivity (dashed line) suggests that increasing growth of young adults by approximately 0·12 would achieve λmax = 1, whereas the transfer function (solid line) indicates that an increase of approximately 0·25 is required. As this would bring the overall survival rate of young adults to above 1 (0·851 + 0·016 + 0·25 = 1·117), it is a biologically unrealistic solution.

For the same perturbation, the transfer function for inertia of a specified demographic structure is modelled using:

n0 <- c(1,1,2,3,5,8,13,21)

tf2 <- inertia.tfa(Tort, vector=n0,      d=c(0,0,0,0,0,0,0,1),

      e = c(0,0,0,0,0,0,1,0), prange = seq(0,0.25,0.01))


Sensitivity analysis of inertia overestimates the negative effect of larger perturbations (Fig. 3b): sensitivity predicts a decline in inertia with an increase in perturbation (dashed line), but the transfer function demonstrates a dramatic shift to increasing inertia at larger perturbation magnitudes (solid line). Nonlinear effects such as these highlight that management strategies based on sensitivity analyses may be ecologically and/or economically inefficient at achieving desired goals.

Deciding on potential management regimes can be difficult. To aid this process, popdemo provides functions to perform transfer function analyses across the whole life cycle. The functions tfamatrix and inertia.tfamatrix generate multiplots of transfer functions, one for every life cycle transition. These plots are laid out in the same way as the PPM, so that the position of each panel in the multiplot indicates which PPM element it corresponds to. Analysing such plots by eye gives an impression of which vital rates are best to target. We provide an example here for inertia.tfamatrix using the desert tortoise PPM:

tfmat <- inertia.tfamatrix(Tort, vector=n0)


Overall, it seems that increasing fecundity may be the best way to promote population amplification (Fig. 4, top row). The plot also shows that most perturbations have a highly nonlinear effect on transient population dynamics.

Figure 4.

 A multiplot of transfer functions for inertia of the desert tortoise population projection matrix, generated using the inertia.tfamatrix function (Appendix S1). Perturbation magnitude is on the x axis, inertia is on the y axis. The layout of the multiplot corresponds with the layout of the PPM. Similar plots can be generated for the transfer function of asymptotic growth using the function tfamatrix.

Another key advantage of using transfer functions is that they can model complex perturbation structures, including simultaneous perturbation to multiple vital rates, different perturbation magnitudes for different vital rates and life cycle trade-offs (Hodgson & Townley 2004; Stott, Hodgson & Townley 2012). This means that transfer functions can accurately model the effect of complicated management regimes [see demo(transfer)].


The tools provided in popdemo facilitate the use of novel analytical methods for basic PPM models. Used alongside traditional analytical approaches, these enable more comprehensive and more predictive analyses of population dynamics, without demand for extra data. The software tools showcased here will likely be of most use for informing population management for relatively data-deficient species. They are also likely to be of use in comparative ecology (Stott et al. 2010b). They have potential application in studying life history evolution: for example, transient dynamics can be used as a measure of resilience (Neubert & Caswell 1997) and transfer functions could be used to model life cycle trade-offs. Lastly, these methods could find application in modelling stage-structured ecological or evolutionary systems other than populations.

For a full index of functions available in popdemo and links to their documentation, run ?popdemo.


We thank Jonathan Ramalheira-Tsu, Chris Coles, Mel Smee, Kim Stokes, Chris Beirne and Jenni Graham for helping to improve popdemo and for providing useful comments on this manuscript. Funding was provided by the European Social Fund.