mizer: an R package for multispecies, trait‐based and community size spectrum ecological modelling
Summary
- Size spectrum ecological models are representations of a community of individuals which grow and change trophic level. A key emergent feature of these models is the size spectrum; the total abundance of all individuals that scales negatively with size. The models we focus on are designed to capture fish community dynamics useful for assessing the community impacts of fishing.
- We present mizer, an R package for implementing dynamic size spectrum ecological models of an entire aquatic community subject to fishing. Multiple fishing gears can be defined and fishing mortality can change through time making it possible to simulate a range of exploitation strategies and management options.
- mizer implements three versions of the size spectrum modelling framework: the community model, where individuals are only characterized by their size; the trait‐based model, where individuals are further characterized by their asymptotic size; and the multispecies model where additional trait differences are resolved.
- A range of plot, community indicator and summary methods are available to inspect the results of the simulations.
Introduction
Size spectrum ecological models are a way to model a community of individuals that grow and change trophic level during life. The models we focus on are designed to capture fish community dynamics (e.g. Benoît & Rochet 2004; Andersen & Beyer 2006; Andersen et al. 2008; Law et al. 2009; Hartvig, Andersen & Beyer 2011). They can be used to understand how aquatic communities are organized (Andersen & Beyer 2006; Andersen, Beyer & Lundberg 2009; Blanchard et al. 2009) and to simulate the community impact of different fishing scenarios, for example fishing forage fish (Engelhard et al. 2014; Houle et al. 2013), fishing large fish (Andersen & Pedersen 2010), ‘balanced’ harvesting (Jacobsen, Gislason & Andersen 2014) and recovery after fishing (Andersen & Rice 2010). Size spectrum models can also be used to evaluate ecosystem management strategies (Blanchard et al. 2014) and the global economics of fishing (Barange et al. 2014). Applications of size spectrum models have focused on marine communities, but they are also applicable for freshwater communities.
We present the R package (R Development Core Team 2014), mizer, for size spectrum ecological modelling. The source code for mizer is hosted at https://github.com/drfinlayscott/mizer. The package can be installed from CRAN. An extensive vignette is available that includes a full description of the model equations and examples (http://cran.r-project.org/web/packages/mizer/vignettes/mizer_vignette.pdf). The package can be used to simulate the size spectrum dynamics in an aquatic community. It is not a ‘community assessment’ tool (i.e. it does not ‘fit’ the model to assess the current state of the community) but simulates the potential consequences of various fishing patterns, conditional on the model assumptions and parameter values.
Model description
(eqn 1)
(eqn 2)Fishing mortality, F, is imposed on individuals by fishing gears. F is a product of the gear selectivity function (the ability of a gear to capture individuals by size, ranging from 0 to 1), fishing effort (a measure of the fishing intensity) and catchability (an additional scalar that relates population abundance to F). Fishing effort can vary through time allowing dynamic harvest patterns to be simulated. Two selectivity functions are included with mizer: ‘knife‐edge’ (where selectivity increases instantly from 0 to 1 at the specified size) and sigmoid (where selectivity increases with size, similar to a selection pattern from a trawl gear). Users are able to define mass‐ and length‐based selectivity functions and different functions, and parameters can be specified for each species in the model. Full details of the model equations and parameters are in Section 3 of the package vignette.
Mizer encompasses three versions of size spectrum models with increasing complexity: the community model (Benoît & Rochet 2004; Maury et al. 2007; Blanchard et al. 2009; Law et al. 2009), the trait‐based model (Andersen & Beyer 2006; Andersen & Pedersen 2010; Andersen & Rice 2010) and the multispecies model (Hartvig, Andersen & Beyer 2011; Blanchard et al. 2014).
In the community model, individuals are only characterized by their size and represent a single group representing an across‐species average. Reproduction is not considered, and the recruitment flux is constant.
The trait‐based model resolves a continuum of species with varying asymptotic sizes. The asymptotic size, Winf, is considered to be the most important trait that characterizes the species life history. The continuum is represented by a discrete number of species spread evenly over the range of asymptotic sizes. The number of species is not important and does not affect the general dynamics of the model (Andersen & Pedersen 2010). Many of the parameters, such as β and σ, are the same for all species. Other model parameters are determined by the asymptotic size. For example, weight at maturation is given by, Wmat = ηm Winf, where the default value of ηm is 0·25.
In the multispecies model, individual species are resolved in detail and each has distinct life history, feeding and reproduction parameters.
In the trait‐based and multispecies models, egg production and recruitment are dependent on the amount of food consumed. The default recruitment function is based on a ‘Beverton–Holt’ type function (Beverton & Holt 1957) where the recruitment flux approaches a maximum as egg production increases. Users are able to specify alternative recruitment functions for each species.
In all three model versions, the species are defined by a series of parameters (Table S1), some of which have default values. Each model version also uses a range of species‐independent parameters (Table S2). More detail on the differences and example uses of each of these approaches is provided in Section 4 of the vignette.
Using mizer
Although size spectrum models can be complex, mizer has been developed so that setting up a model, running a simulation and inspecting the results are straightforward.
A class, MizerParams, is used for model parameters. For community and trait‐based models, wrapper functions set_community_model() and set_trait_model() can be used to easily create an appropriate MizerParams object. All function arguments have default values to allow the user to quickly set up and explore the dynamics of size spectrum models. However, these default values may not be appropriate for all case studies. To set up the multispecies model, the MizerParams() constructor method is used, which has two main arguments: a data frame of species parameters (Table S1) and an interaction matrix which holds the species prey preference. A demonstration multispecies data set is included in the package, based on the North Sea (Blanchard et al. 2014).
Simulations are run by calling project(). Fishing mortality is controlled by the fishing effort of each gear and can be specified independently by gear through time, to explore the impact of changing fishing pressures on different groups of species. Additionally, it is possible to use observed historical fishing pressures in the simulations (see the vignette and Blanchard et al. 2014).
The output of project() is an object of class MizerSim which contains the simulation results including species abundances by size and time. The results can be explored using plot, summary and indicator methods (Table S3). For example, one indicator of the impact of fishing is the slope of the community spectrum. This can be calculated using getCommunitySlope(). The size range of the calculation can be specified to capture the size range that is sampled by field surveys.
Examples
Two mizer examples exploring fishing impacts on different parts of the community are shown below. The code is provided in the additional supporting material (Appendix S1). Further examples can be found in the package vignette.
The first example simulates a trophic cascade using all three models (Fig. 2). Here all species are fished with a knife‐edge selectivity so that only individuals >1000 g are selected (a simplification as selectivity is normally species‐specific, possible with mizer). The simulations are run to equilibrium to investigate equilibrium fished and unfished states (details can be found in the vignette). The fishing pressure lowers the relative abundance of fish >1000 g and reduces predation pressure on smaller prey, leading to an increase in their abundance. This in turn increases predation mortality on even smaller sizes, reducing their abundance and so on, causing a size‐structured cascade.

In the second example, a multispecies model based on the North Sea is fished by four different gears (pelagic, otter, beam and industrial), each of which selects a different group of the 12 species in the model (Fig. 3). The gears have knife‐edge selectivity, but the size at selection differs between gears (again, this is a simplification, as selectivity is usually gear and species‐specific). The simulation is run for 100 years, from equilibrium unfished abundances. The large predatory species are cod, whiting, saithe and haddock. Sprat, sandeel and herring are smaller forage fish that consume the resource spectrum. The fishing gears are ‘turned on’ in sequence so that fishing pressure on different parts of the community varies with time. The community‐wide impacts of fishing are manifest in the abundances, yields and community metrics. For example, when the otter gear starts fishing, the beam gear yields increase as the predation pressure from species caught by the otter gear declines. The slope of the community also becomes less negative. Turning on the industrial fishery targeting forage fish leads to a marked increase in the mean maximum weight in the community and has a negative impact on the yields of the species caught by the other gears.

Conclusions and future directions
The mizer package can be used by fisheries scientists and ecologists who wish to use size spectrum models to explore the impacts of exploitation on aquatic communities. The usefulness of community indicators, such as the slope of the community spectrum, can also be tested by evaluating how responsive they are to changes in fishing pressure. Additionally, the package may be of use for teaching the principles of size spectrum modelling.
Several developments have been planned for future releases. Currently, the model is purely deterministic, and it is not possible to quantify the uncertainty in the results. The inclusion of stochasticity, for example in the recruitment function, will help to address this.
For the model to simulate a real ecosystem, it must be parameterized. This is done outside mizer based on either the literature or a statistical analysis of growth, maturation and diet data (Blanchard et al. 2014). Calibration of the least‐known parameters (e.g. carrying capacity of the background resource and species maximum recruitment) is required. Statistical parameter estimation to fit the emergent abundance patterns of dynamic size spectrum models to data is an area of current and future methodological development and could be carried out through the use of optimization (Blanchard et al. 2014), maximum likelihood or Bayesian inference algorithms.
Acknowledgements
This work was supported by the European Commission (Framework 6 Project IMAGE, Framework 7 Projects DEEPFISHMAN, MEECE, FACTS and MYFISH) the UK Department of the Environment Food and Rural Affairs (projects MF1001, MF1202 and MF1225) and the European Science Foundation SIZEMIC Research Network. KHA acknowledges additional support from the VKR foundation through the Centre for Ocean Life.
Data accessibility
This paper does not use data.
References
Citing Literature
Number of times cited according to CrossRef: 34
- AM Edwards, JPW Robinson, JL Blanchard, JK Baum, MJ Plank, Accounting for the bin structure of data removes bias when fitting size spectra, Marine Ecology Progress Series, 10.3354/meps13230, 636, (19-33), (2020).
- T. Mariella Canales, Gustav W. Delius, Richard Law, Regulation of fish stocks without stock–recruitment relationships: The case of small pelagic fish, Fish and Fisheries, 10.1111/faf.12465, 21, 5, (857-871), (2020).
- Ryan F. Heneghan, Jason D. Everett, Patrick Sykes, Sonia D. Batten, Martin Edwards, Kunio Takahashi, Iain M. Suthers, Julia L. Blanchard, Anthony J. Richardson, A functional size-spectrum model of the global marine ecosystem that resolves zooplankton composition, Ecological Modelling, 10.1016/j.ecolmodel.2020.109265, 435, (109265), (2020).
- Anne Babcock Hollowed, Kirstin Kari Holsman, Alan C. Haynie, Albert J. Hermann, Andre E. Punt, Kerim Aydin, James N. Ianelli, Stephen Kasperski, Wei Cheng, Amanda Faig, Kelly A. Kearney, Jonathan C. P. Reum, Paul Spencer, Ingrid Spies, William Stockhausen, Cody S. Szuwalski, George A. Whitehouse, Thomas K. Wilderbuer, Integrated Modeling to Evaluate Climate Change Impacts on Coupled Social-Ecological Systems in Alaska, Frontiers in Marine Science, 10.3389/fmars.2019.00775, 6, (2020).
- Jonathan C. P. Reum, Julia L. Blanchard, Kirstin K. Holsman, Kerim Aydin, Anne B. Hollowed, Albert J. Hermann, Wei Cheng, Amanda Faig, Alan C. Haynie, André E. Punt, Ensemble Projections of Future Climate Change Impacts on the Eastern Bering Sea Food Web Using a Multispecies Size Spectrum Model, Frontiers in Marine Science, 10.3389/fmars.2020.00124, 7, (2020).
- Michael A. Spence, Hayley J. Bannister, Johnathan E. Ball, Paul J. Dolder, Christopher A. Griffiths, Robert B. Thorpe, LeMaRns: A Length-based Multi-species analysis by numerical simulation in R, PLOS ONE, 10.1371/journal.pone.0227767, 15, 2, (e0227767), (2020).
- Christopher F. Clements, Michael A. McCarthy, Julia L. Blanchard, Early warning signals of recovery in complex systems, Nature Communications, 10.1038/s41467-019-09684-y, 10, 1, (2019).
- Carl Walters, Villy Christensen, Effect of non-additivity in mortality rates on predictions of potential yield of forage fishes, Ecological Modelling, 10.1016/j.ecolmodel.2019.108776, 410, (108776), (2019).
- Rui Ying, Fangmin Yin, Li Jiang, Zufu Li, Jianrong Huang, Yingyong Wang, Jianguo Lu, Jianxiang Feng, Fitting methods and seasonality effects on the assessment of pelagic fish communities in Daya Bay, China, Ecological Indicators, 10.1016/j.ecolind.2019.04.042, 103, (346-354), (2019).
- Asta Audzijonyte, Heidi Pethybridge, Javier Porobic, Rebecca Gorton, Isaac Kaplan, Elizabeth A. Fulton, Atlantis: A spatially explicit end‐to‐end marine ecosystem model with dynamically integrated physics, ecology and socio‐economic modules, Methods in Ecology and Evolution, 10.1111/2041-210X.13272, 10, 10, (1814-1819), (2019).
- Axel G. Rossberg, Ursula Gaedke, Pavel Kratina, Dome patterns in pelagic size spectra reveal strong trophic cascades, Nature Communications, 10.1038/s41467-019-12289-0, 10, 1, (2019).
- Shijie Zhou, Jeppe Kolding, Serge M. Garcia, Michael J. Plank, Alida Bundy, Anthony Charles, Cecilie Hansen, Mikko Heino, Daniel Howell, Nis S. Jacobsen, David G. Reid, Jake C. Rice, Paul A. M. van Zwieten, Balanced harvest: concept, policies, evidence, and management implications, Reviews in Fish Biology and Fisheries, 10.1007/s11160-019-09568-w, (2019).
- Phoebe A. Woodworth-Jefcoats, Julia L. Blanchard, Jeffrey C. Drazen, Relative Impacts of Simultaneous Stressors on a Pelagic Marine Ecosystem, Frontiers in Marine Science, 10.3389/fmars.2019.00383, 6, (2019).
- Stacey A. McCormack, Rowan Trebilco, Jessica Melbourne-Thomas, Julia L. Blanchard, Elizabeth A. Fulton, Andrew Constable, Using stable isotope data to advance marine food web modelling, Reviews in Fish Biology and Fisheries, 10.1007/s11160-019-09552-4, (2019).
- R Proud, MJ Cox, C Le Guen, AS Brierley, Fine-scale depth structure of pelagic communities throughout the global ocean based on acoustic sound scattering layers, Marine Ecology Progress Series, 10.3354/meps12612, 598, (35-48), (2018).
- Chongliang Zhang, Yong Chen, Binduo Xu, Ying Xue, Yiping Ren, Evaluating fishing effects on the stability of fish communities using a size-spectrum model, Fisheries Research, 10.1016/j.fishres.2017.09.004, 197, (123-130), (2018).
- Roland Proud, Nils Olav Handegard, Rudy J Kloser, Martin J Cox, Andrew S Brierley, From siphonophores to deep scattering layers: uncertainty ranges for the estimation of global mesopelagic fish biomass, ICES Journal of Marine Science, 10.1093/icesjms/fsy037, (2018).
- Shujuan Xia, Takashi Yamakawa, A size-structured matrix model to simulate dynamics of marine community size spectrum, PLOS ONE, 10.1371/journal.pone.0198415, 13, 6, (e0198415), (2018).
- Chongliang Zhang, Yong Chen, Yiping Ren, Rong Wan, Evaluating the sensitivity of ecological indicators with a perspective of temporal scales, Marine and Freshwater Research, 10.1071/MF16084, 68, 9, (1664), (2017).
- Kirsty L. Nash, Christopher Cvitanovic, Elizabeth A. Fulton, Benjamin S. Halpern, E. J. Milner-Gulland, Reg A. Watson, Julia L. Blanchard, Planetary boundaries for a blue planet, Nature Ecology & Evolution, 10.1038/s41559-017-0319-z, 1, 11, (1625-1634), (2017).
- Julia L. Blanchard, Ryan F. Heneghan, Jason D. Everett, Rowan Trebilco, Anthony J. Richardson, From Bacteria to Whales: Using Functional Size Spectra to Model Marine Ecosystems, Trends in Ecology & Evolution, 10.1016/j.tree.2016.12.003, 32, 3, (174-186), (2017).
- Jason D. Everett, Mark E. Baird, Pearse Buchanan, Cathy Bulman, Claire Davies, Ryan Downie, Chris Griffiths, Ryan Heneghan, Rudy J. Kloser, Leonardo Laiolo, Ana Lara-Lopez, Hector Lozano-Montes, Richard J. Matear, Felicity McEnnulty, Barbara Robson, Wayne Rochester, Jenny Skerratt, James A. Smith, Joanna Strzelecki, Iain M. Suthers, Kerrie M. Swadling, Paul van Ruth, Anthony J. Richardson, Modeling What We Sample and Sampling What We Model: Challenges for Zooplankton Model Assessment, Frontiers in Marine Science, 10.3389/fmars.2017.00077, 4, (2017).
- Chongliang Zhang, Yong Chen, Binduo Xu, Ying Xue, Yiping Ren, Sampling effects on the effectiveness of ecological indicators in detecting fishery-induced community changes, Canadian Journal of Fisheries and Aquatic Sciences, 10.1139/cjfas-2017-0199, (1-10), (2017).
- Cody S. Szuwalski, Matthew G. Burgess, Christopher Costello, Steven D. Gaines, High fishery catches through trophic cascades in China, Proceedings of the National Academy of Sciences, 10.1073/pnas.1612722114, 114, 4, (717-721), (2016).
- Andrew M. Edwards, James P. W. Robinson, Michael J. Plank, Julia K. Baum, Julia L. Blanchard, Testing and recommending methods for fitting size spectra to data, Methods in Ecology and Evolution, 10.1111/2041-210X.12641, 8, 1, (57-67), (2016).
- Chongliang Zhang, Yong Chen, Yiping Ren, The efficacy of fisheries closure in rebuilding depleted stocks: Lessons from size-spectrum modeling, Ecological Modelling, 10.1016/j.ecolmodel.2016.04.001, 332, (59-66), (2016).
- Chongliang Zhang, Yong Chen, Katherine Thompson, Yiping Ren, Implementing a multispecies size-spectrum model in a data-poor ecosystem, Acta Oceanologica Sinica, 10.1007/s13131-016-0822-0, 35, 4, (63-73), (2016).
- Jérôme Guiet, Jean-Christophe Poggiale, Olivier Maury, Modelling the community size-spectrum: recent developments and new directions, Ecological Modelling, 10.1016/j.ecolmodel.2016.05.015, 337, (4-14), (2016).
- Henrique C. Giacomini, Brian J. Shuter, Julia K. Baum, Size-based approaches to aquatic ecosystems and fisheries science: a symposium in honour of Rob Peters, Canadian Journal of Fisheries and Aquatic Sciences, 10.1139/cjfas-2016-0100, 73, 4, (471-476), (2016).
- Ken H. Andersen, Nis S. Jacobsen, K.D. Farnsworth, The theoretical foundations for size spectrum models of fish communities, Canadian Journal of Fisheries and Aquatic Sciences, 10.1139/cjfas-2015-0230, 73, 4, (575-588), (2016).
- Michael A. Spence, Paul G. Blackwell, Julia L. Blanchard, Parameter uncertainty of a dynamic multispecies size spectrum model, Canadian Journal of Fisheries and Aquatic Sciences, 10.1139/cjfas-2015-0022, 73, 4, (589-597), (2016).
- Chongliang Zhang, Yong Chen, Yiping Ren, An evaluation of implementing long-term MSY in ecosystem-based fisheries management: Incorporating trophic interaction, bycatch and uncertainty, Fisheries Research, 10.1016/j.fishres.2015.10.007, 174, (179-189), (2016).
- Ryan F. Heneghan, Jason D. Everett, Julia L. Blanchard, Anthony J. Richardson, Zooplankton Are Not Fish: Improving Zooplankton Realism in Size-Spectrum Models Mediates Energy Transfer in Food Webs, Frontiers in Marine Science, 10.3389/fmars.2016.00201, 3, (2016).
- Chongliang Zhang, Yong Chen, Yiping Ren, Assessing uncertainty of a multispecies size-spectrum model resulting from process and observation errors, ICES Journal of Marine Science: Journal du Conseil, 10.1093/icesjms/fsv086, 72, 8, (2223-2233), (2015).




