Skip to contents

Overview

This page gives a mathematical description of the mizerReef model. mizerReef is an extension of mizer, and this page assumes that you are already familiar with the general mizer model. We use the same notation as in the mizer model description and concentrate on the places where mizerReef departs from or adds to core mizer. Everything not mentioned here (the size-spectrum dynamics, the shape of the predation kernel, the growth and reproduction machinery, the fishing model, and so on) is inherited unchanged from mizer.

mizerReef is designed for structurally complex habitats such as coral reefs. It adds four ingredients to the standard multispecies model:

  1. Predation refuge. Structural complexity lets some prey hide from some predators. This is captured by a size- and species-dependent vulnerability Vji(w)V_{ji}(w) that discounts both the food a predator encounters and the predation mortality it inflicts.
  2. Unstructured resources. In addition to the size-structured resource spectrum NR(w)N_R(w) (plankton), mizerReef tracks two non-size-structured benthic pools: algae with biomass BAB_A and detritus with biomass BDB_D.
  3. Satiation control. Individual consumer groups can be exempted from the Holling type II satiation response, so that carnivores take all the food they encounter.
  4. Senescence mortality. An extra size-dependent mortality term μsen.i(w)\mu_{sen.i}(w) acting near a group’s maximum size, on top of the residual natural mortality.

Throughout, the index ii (or jj) runs over the modelled functional groups rather than taxonomic species; in mizerReef the entries of Ni(w)N_i(w) are usually size spectra of feeding guilds.

State variables

A mizerReef model carries the same consumer spectra Ni(w)N_i(w) and resource spectrum NR(w)N_R(w) as mizer, together with two additional scalar state variables:

  • BAB_A, the total biomass of algae (turf, macroalgae and the epilithic algal matrix), and
  • BDB_D, the total biomass of detritus (decomposing organic matter, faeces and material sinking in from the pelagic zone).

Neither pool is size-structured, reflecting the fact that reef herbivores and detritivores feed on these resources largely independently of their own body size. Their dynamics are given in the section on unstructured resource dynamics. They are stored as other components of the model (n_other$algae and n_other$detritus) and evolve alongside the fish and plankton spectra.

Predation refuge and vulnerability

The central mechanism in mizerReef is that habitat structure shelters prey from predators. We describe this with the vulnerability Vji(w)V_{ji}(w): the proportion of individuals of prey group ii at size ww that are not hidden inside refuge and are therefore available to be encountered and eaten by predator group jj. It is a dimensionless number between 00 and 11, computed by reefVulnerable() and returned by getVulnerable().

Two group-level flags in the species parameter table decide who is affected:

  • refuge_user marks the prey groups ii that seek shelter. Groups that never use refuge have Vji(w)=1V_{ji}(w) = 1 for all predators and sizes.
  • blocked_pred marks the predator groups jj whose foraging is obstructed by structure. A predator with blocked_pred = FALSE (for example an eel that can follow prey into a crevice) is unaffected by refuge and always sees Vji(w)=1V_{ji}(w) = 1.

Writing Ri(w)R_i(w) for the proportion of refuge-using prey group ii that are sheltered at size ww (the refuge profile, defined below), the vulnerability is Vji(w)={1Ri(w)if group i uses refuge and predator j is blocked,1otherwise. V_{ji}(w) = \begin{cases} 1 - R_i(w) & \text{if group } i \text{ uses refuge and predator } j \text{ is blocked,}\\ 1 & \text{otherwise.} \end{cases} Because the sheltering depends on the prey only, Vji(w)V_{ji}(w) takes just two possible values for each prey group and size — the discounted value 1Ri(w)1-R_i(w) for blocked predators and 11 for predators that can reach into refuge.

The refuge profile is capped at a maximum protection level, Ri(w)rmaxR_i(w) \le r_{\max} (max_protect, default 0.980.98), so that some food always remains accessible.

Refuge profiles

The refuge profile Ri(w)R_i(w) is set with setRefuge(), which offers three ways to specify it plus a trivial “no refuge” option. All three convert between length and weight using length–weight parameters aa and bb (so that w=aLbw = a\, L^{b}), using either group-specific values or a set of “dummy fish” values a,b\bar a, \bar b, depending on how the field data were collected.

Sigmoidal. A smooth decline in protection around a threshold length LrefugeL_{\text{refuge}}, appropriate when the refuge-size distribution is unknown. With threshold weight Wrefuge=aLrefugebW_{\text{refuge}} = a\,L_{\text{refuge}}^{\,b}, Ri(w)=r1+exp(Δ(wWrefuge)), R_i(w) = \frac{r}{1 + \exp\!\big(\Delta\,(w - W_{\text{refuge}})\big)}, where rr (prop_protect) is the maximum proportion protected and Δ\Delta (slope) sets the sharpness of the transition.

Binned. A step function that is appropriate for theoretical experiments. On a set of length bins with weight edges wk1<wwkw_{k-1} < w \le w_k, Ri(w)=rkfor w(wk1,wk], R_i(w) = r_k \qquad \text{for } w \in (w_{k-1}, w_k], with a constant protected proportion rkr_k in each bin.

Competitive. The mechanistic, density-dependent option, used when the density of physical refuges is known. Let ηk\eta_k be the density of refuges (number per m²) in size bin kk. These refuges are shared out among all refuge-using individuals whose size falls in that bin, so the protected proportion is the ratio of available refuges to competitors: Ri(w)=min(rmax,τηkwk1wkN(w)dw),w(wk1,wk], R_i(w) = \min\!\left(r_{\max},\; \tau \, \frac{\eta_k} {\displaystyle\sum_{\ell}\int_{w_{k-1}}^{w_k} N_\ell(w')\,dw'}\right), \qquad w \in (w_{k-1}, w_k], where the sum runs over all refuge-using groups \ell and τ\tau (tau, default 11) is the fraction of individuals with access to a refuge that actually use it. When there are no competitors the protection is set to rmaxr_{\max}.

The competitive profile is the only one that couples back to the fish abundances: as a size class becomes crowded, the same number of refuges protect a smaller fraction of it, so vulnerability rises with density. This provides an additional, habitat-mediated source of density dependence that is recomputed at every time step. The static sigmoidal and binned profiles, by contrast, are fixed once set.

Refuge profile curves showing protected proportion declining with body size.

Refuge profile for the built-in Caribbean example model: the proportion protected by refuge as a function of body size for each functional group.

Habitat degradation

The competitive method also supports time-dependent loss of structure, used to simulate bleaching or physical damage (setDegradation(), reefDegrade()). The refuge density is scaled forward in time by a sequence of factors: from a bleaching time tbleacht_{\text{bleach}} onwards, ηk(t)=sk(t)ηk(t1), \eta_k(t) = s_k(t)\,\eta_k(t-1), where the sk(t)s_k(t) are user-supplied scaling factors (the columns of deg_scale) giving the fractional change in refuge density in each successive year post-disturbance. Optionally the algal growth rate and carrying capacity can be boosted over the same period to represent the algal proliferation that often follows coral loss.

Encounter rate

The predation encounter rate has the same form as in mizer but with two modifications: prey abundances are discounted by their vulnerability, and the unstructured resources contribute additional, non-size-structured food.

For a predator of group ii and weight ww, Ei(w)=γi(w)(θiRNR(wp)+jθijVij(wp)Nj(wp))ϕi(w,wp)wpdwp+Ei,A(w)+Ei,D(w). E_i(w) = \gamma_i(w) \int \left( \theta_{iR}\,N_R(w_p) + \sum_{j} \theta_{ij}\, V_{ij}(w_p)\, N_j(w_p) \right) \phi_i(w, w_p)\, w_p \, dw_p \;+\; E_{i,A}(w) + E_{i,D}(w). Compared with mizer, the fish-prey term now carries the factor Vij(wp)V_{ij}(w_p), which removes the sheltered fraction of each prey group from the food available to predator ii. The plankton resource NRN_R is not affected by refuge. The search volume γi(w)\gamma_i(w), interaction coefficients θij\theta_{ij}, θiR\theta_{iR} and predation kernel ϕi\phi_i are exactly as in mizer, and the integral is evaluated by the same fast Fourier transform when the kernel depends only on the predator/prey size ratio. This rate is computed by reefEncounter().

The last two terms are the contributions from feeding on the unstructured resources. Because these pools are not size-structured, the encounter rate on each is simply proportional to its total biomass: Ei,A(w)=ρi,Aθi,AwmalgBA,Ei,D(w)=ρi,Dθi,DwmdetBD, E_{i,A}(w) = \rho_{i,A}\,\theta_{i,A}\, w^{m_{alg}}\, B_A, \qquad E_{i,D}(w) = \rho_{i,D}\,\theta_{i,D}\, w^{m_{det}}\, B_D, where θi,A\theta_{i,A} and θi,D\theta_{i,D} (interaction_algae, interaction_detritus) set each group’s preference for algae and detritus, the coefficients ρi,A,ρi,D\rho_{i,A}, \rho_{i,D} set the overall consumption power, and the allometric exponents malg,mdetm_{alg}, m_{det} control how intake scales with consumer size. This contribution is added through mizer’s standard component mechanism (encounter_contribution()).

Consumption and satiation

As in mizer, encountered food is consumed subject to a Holling type II functional response, giving the feeding level fi(w)=Ei(w)Ei(w)+hi(w), f_i(w) = \frac{E_i(w)}{E_i(w) + h_i(w)}, where hi(w)h_i(w) is the maximum intake rate. The proportion 1fi(w)1 - f_i(w) of encountered food is actually consumed, and the absorbed rate available for metabolism, growth and reproduction is αi(1fi(w))Ei(w)\alpha_i (1 - f_i(w)) E_i(w).

mizerReef adds a per-group satiation switch (satiation). Groups with satiation = FALSE have no upper limit on their intake, formally hi(w)=h_i(w) = \infty. For them the feeding level collapses to fi(w)=0, f_i(w) = 0, so they consume everything they encounter and the absorbed rate is simply αiEi(w)\alpha_i E_i(w). This behaviour is implemented by reefFeedingLevel(), which sets the maximum intake to infinity for non-satiating groups and treats the resulting 0/00/0 feeding level as zero.

By default, only species that consume detritus but not algae (i.e. pure detritivores/invertebrates) keep the type II response (satiation = TRUE); carnivores and herbivores both default to satiation = FALSE (see setRefuge()), since satiation-mediated consumption is intended to be exclusive to detritivory — see the Algae section below for the citations behind this default for herbivores specifically. This is a default, not a hard rule: caribbean_3_model and caribbean_10_model (karpata) both override it to satiation = TRUE for their herbivore/parrotfish groups, because recalibrating those models against the corrected senescence-mortality formula showed herbivore biomass has no density-dependent brake at all without some cap on individual intake once mortality is realistically low (see inst/scripts/Caribbean_3_model-calibration.R‘s design note for the full reasoning) — the underlying “herbivores don’t reduce grazing pressure on the shared algae pool” claim these citations support is unaffected by this, since algae_consumption() (the resource-depletion rate) deliberately ignores feeding level regardless of any species’ satiation setting.

Growth and reproduction

The partitioning of absorbed energy into metabolism, growth and reproduction is unchanged from mizer. After metabolic losses metabi(w)\text{metab}_i(w), the rate available for growth and reproduction is Er.i(w)=max(0,αi(1fi(w))Ei(w)metabi(w)), E_{r.i}(w) = \max\!\big(0,\; \alpha_i (1 - f_i(w))\, E_i(w) - \text{metab}_i(w)\big), a fraction ψi(w)\psi_i(w) of which goes to reproduction and the remainder to somatic growth, gi(w)=Er.i(w)(1ψi(w))g_i(w) = E_{r.i}(w)\,(1 - \psi_i(w)). Reproduction uses the same egg-production integral and the same emergent Beverton–Holt stock–recruitment relationship as mizer. See the mizer model description for details.

Mortality

The total mortality on a consumer of group ii and weight ww is μi(w)=μp.i(w)+μnat.i(w)+μsen.i(w)+Fi(w), \mu_i(w) = \mu_{p.i}(w) + \mu_{nat.i}(w) + \mu_{sen.i}(w) + F_i(w), computed by reefMort(). Fishing mortality Fi(w)F_i(w) is exactly as in mizer. The remaining three terms differ from core mizer as follows.

Predation mortality

All food eaten becomes predation mortality on the prey, but only the vulnerable, non-sheltered individuals can be eaten. The predation mortality on prey group ii at size wpw_p is μp.i(wp)=jpred_ratej(wp)Vji(wp)θji, \mu_{p.i}(w_p) = \sum_j \text{pred\_rate}_j(w_p)\, V_{ji}(w_p)\, \theta_{ji}, where pred_ratej\text{pred\_rate}_j is the same predation rate as in mizer (computed from predator jj’s feeding). The extra factor Vji(wp)V_{ji}(w_p) discounts the contribution of each predator jj by the fraction of prey ii that is exposed to it: predators that are blocked by refuge (blocked_pred = TRUE) only prey on the 1Ri(wp)1 - R_i(w_p) fraction that is out in the open, while predators that can reach into refuge apply the full mortality. This is computed by reefPredMort().

Residual natural mortality

Mortality from sources not modelled explicitly (predators outside the model, disease, and so on) is taken to be allometric in size, μnat.i(w)=μnatw1n, \mu_{nat.i}(w) = \mu_{nat}\, w^{\,1-n}, with μnat\mu_{nat} the rate at 11 g (nat_mort, default 0.20.2) and nn the growth exponent. This is mizerReef’s external mortality μext.i(w)\mu_{ext.i}(w) and plays the same role as z0iz0_i in mizer.

Senescence mortality

To represent death from old age near a group’s maximum size, mizerReef adds a size-increasing senescence term (reefSenMort(), getSenMort()): μsen.i(w)=ksen(log10wlog10wmax.i)psen, \mu_{sen.i}(w) = k_{sen}\, \left(\frac{\log_{10} w}{\log_{10} w_{max.i}} \right)^{p_{sen}}, with the ratio floored at zero for w<1w < 1 g. Here wmax.iw_{max.i} is the maximum weight of group ii, ksenk_{sen} (sen_prop) is the rate the curve approaches as wwmax.iw \to w_{max.i} (where the ratio is exactly 1), and psenp_{sen} (sen_curve) controls the steepness with which mortality climbs as individuals approach their maximum size. Senescence mortality is included only when the model is set up to use it; both it and the residual natural mortality are configured through setExtMortParams().

Resource mortality

Predation mortality on the plankton resource NR(w)N_R(w) is computed exactly as in mizer. The predation losses on the unstructured pools BAB_A and BDB_D are accounted for through their consumption terms in the dynamics below rather than as a size-resolved mortality.

Unstructured resource dynamics

The algae and detritus pools each obey a linear balance between production and consumption. Because they are single scalars, their dynamics are ordinary differential equations that mizerReef solves analytically over each time step of length dtdt, which avoids the numerical instability of an explicit Euler step. The general mathematical form of these dynamics – a linear production/ consumption balance for each unstructured pool, solved analytically each time step – was adapted from the mizerShelf extension package (Delius et al. 2022, de Juan et al. 2023). This is not a direct port, though: mizerShelf represents its detritus/carrion pools by rescaling the total biomass of mizer’s size-structured background resource spectrum, whereas mizerReef’s algae and detritus are genuinely unstructured scalar pools with their own dedicated species- and size-dependent encounter-rate matrices (ρ\rho), added as independent components via setComponent(). mizerReef also adds coral-reef-specific behaviour with no equivalent in mizerShelf, most notably that algae production is treated as a fixed rate of primary production decoupled from consumer demand rather than tuned to match consumption (see algae_consumption()’s documentation for the ecological rationale and citations).

Algae

The algal biomass follows dBAdt=PAcABA, \frac{dB_A}{dt} = P_A - c_A\, B_A, where PAP_A is the production rate. Unlike detritus, algal production on a reef is real primary production and is not driven by grazer demand, so PAP_A is a fixed, literature-informed constant (getAlgaeProduction(), see setAlgaeParams()) rather than something tuned to match consumption; instead it is the algae biomass BAB_A that is solved for at steady state (tuneUR()/tuneUR_cc()), so that, all else equal, a decrease in grazing pressure increases the standing algae biomass rather than reducing modelled production to compensate. cAc_A is the mass-specific consumption rate (algae_consumption()). The latter is the total rate at which consumers graze the pool per unit of algal biomass, cA=iρi,Aθi,AwmalgNi(w)dw, c_A = \sum_i \int \rho_{i,A}\,\theta_{i,A}\, w^{m_{alg}}\, N_i(w)\, dw, so that the total grazing rate is cABAc_A B_A. Note that, unlike detritus consumption below, this deliberately does not include a feeding-level factor: in mizerReef, satiation-mediated consumption is exclusive to detritivory. Increases in herbivorous fish density following coral bleaching events suggest that reef herbivores respond to increased food availability without regulating their consumption (Ledlie et al. 2007, Pratchett et al. 2008, Khalil et al. 2013, Elma et al. 2023), and Caribbean herbivores have been observed to fill their gut up to three times a day (Ferreira et al. 1998, Kopp et al. 2010). Algal consumption is therefore modelled as driven by continuous grazing pressure regardless of the satiation setting for the herbivore species involved – see algae_consumption()’s documentation for more detail. Over a step the equation integrates to BA(t+dt)=BA(t)ecAdt+PAcA(1ecAdt). B_A(t + dt) = B_A(t)\, e^{-c_A\, dt} + \frac{P_A}{c_A}\left(1 - e^{-c_A\, dt}\right).

Detritus

Detritus obeys the same form, dBDdt=PDcDBD,BD(t+dt)=BD(t)ecDdt+PDcD(1ecDdt), \frac{dB_D}{dt} = P_D - c_D\, B_D, \qquad B_D(t + dt) = B_D(t)\, e^{-c_D\, dt} + \frac{P_D}{c_D}\left(1 - e^{-c_D\, dt}\right), with mass-specific consumption cD=iρi,Dθi,Dwmdet(1fi(w))Ni(w)dw c_D = \sum_i \int \rho_{i,D}\,\theta_{i,D}\, w^{m_{det}} \big(1 - f_i(w)\big)\, N_i(w)\, dw (detritus_consumption()). Unlike algae, detritus is produced by several processes in the ecosystem, and its production rate is the sum of three contributions (getDetritusProduction()): PD=pD,f+pD,d+pD,ext. P_D = p_{D,f} + p_{D,d} + p_{D,\text{ext}}.

  • Faeces — the fraction of consumed biomass that is not assimilated: pD,f=i(1αi)(1fi(w))Ei(w)Ni(w)dw. p_{D,f} = \sum_i (1 - \alpha_i) \int \big(1 - f_i(w)\big)\, E_i(w)\, N_i(w)\, dw.
  • Decomposing carcasses — a fraction of the biomass lost to residual natural and senescence mortality: pD,d=cextiμnat.i(w)Ni(w)wdw+cseniμsen.i(w)Ni(w)wdw, p_{D,d} = c_{ext}\sum_i \int \mu_{nat.i}(w)\, N_i(w)\, w\, dw + c_{sen}\sum_i \int \mu_{sen.i}(w)\, N_i(w)\, w\, dw, where cextc_{ext} (ext_decomp) and csenc_{sen} (sen_decomp) are the proportions of each mortality source that decompose to detritus rather than being exported.
  • External input pD,extp_{D,\text{ext}} — a constant rate at which detritus enters from unmodelled sources such as sponges, coral mucus and pelagic sinking (external), set to close the steady-state budget.

Carrying-capacity variant

For scenarios in which the benthos saturates, both pools can instead be given logistic production (setURcapacity(), algae_dynamics_cc(), detritus_dynamics_cc()): dBdt=P(1BK)cB, \frac{dB}{dt} = P\left(1 - \frac{B}{K}\right) - c\, B, with carrying capacity KK. This too is solved analytically over each step, B(t+dt)=B(t)edtK(P+Kc)+KPP+Kc(1edtK(P+Kc)), B(t + dt) = B(t)\, e^{-\frac{dt}{K}(P + K c)} + \frac{K P}{P + K c}\left(1 - e^{-\frac{dt}{K}(P + K c)}\right), and reduces to the linear case as KK \to \infty.

Summary of differences from mizer

Process mizer mizerReef
Prey availability full abundance Nj(w)N_j(w) discounted by vulnerability Vij(w)Nj(w)V_{ij}(w)\,N_j(w)
Encounter plankton + fish plankton + fish + algae + detritus
Satiation all groups optional; off for carnivores
External mortality constant z0iz0_i μnatw1n\mu_{nat}\,w^{1-n} plus senescence μsen.i(w)\mu_{sen.i}(w)
Extra resources resource spectrum only plus unstructured pools BAB_A, BDB_D

For how these equations are realised through mizer’s extension mechanism (S3 dispatch, NextMethod() chaining and registered components), see the extension mechanism vignette.

de Juan, S., G. Delius, and F. Maynou. 2023. A model of size-spectrum dynamics to estimate the effects of improving fisheries selectivity and reducing discards in mediterranean mixed demersal fisheries. Fisheries Research 266:106764.
Delius, G., S. de Juan, and F. Maynou. 2022. mizerShelf: Mizer models with carrion and detritus components suitable for continental shelf ecosystems.
Elma, E., M. Gullström, S. A. S. Yahya, J.-B. Jouffray, H. K. East, and M. Nyström. 2023. Post-bleaching alterations in coral reef communities. Marine Pollution Bulletin 186:114479.
Ferreira, D. E. L., A. C. Peret, and R. Coutinho. 1998. Seasonal grazing rates and food processing by tropical herbivorous fishes. Journal of Fish Biology 53:222–235.
Khalil, M. T., J. E. M. Cochran, and M. L. Berumen. 2013. The abundance of herbivorous fish on an inshore red sea reef following a mass coral bleaching event. Environmental Biology of Fishes 96:1065–1072.
Kopp, D., Y. Bouchon-Navaro, S. Cordonnier, A. Haouisée, M. Louis, and C. Bouchon. 2010. Evaluation of algal regulation by herbivorous fishes on caribbean coral reefs. Helgoland Marine Research 64:181–190.
Ledlie, M. H., N. A. J. Graham, J. C. Bythell, S. K. Wilson, S. Jennings, N. V. C. Polunin, and J. Hardcastle. 2007. Phase shifts and the role of herbivory in the resilience of coral reefs. Coral Reefs 26:641–653.
Pratchett, M., P. Munday, S. Wilson, N. Graham, J. Cinner, D. Bellwood, G. Jones, N. Polunin, and T. McClanahan. 2008. Effects of climate-induced coral bleaching on coral-reef fishes: Ecological and economic consequences. Oceanography and Marine Biology: An Annual Review 46:251–296.