Skip to contents

A stomach-content distribution is a realized outcome: it depends on predator preference, available prey, ingestion, digestion, and sampling. A mizer feeding kernel (Scott, Blanchard, and Andersen 2014) represents only the prey-size dependence of encounter and selection. Connecting the two therefore requires assumptions.

This article derives the transformation used by set_kernel_params() and shows how it is applied. The weighting notation is introduced in vignette("density_functions"); distribution selection and diagnostics are discussed in vignette("PPMR_distributions").

Assumptions

The package uses the following approximation:

  1. The log predator/prey mass-ratio distribution is adequately independent of predator mass over the fitted range.
  2. Stomach contents are in a statistical steady state: prey of each size enter stomachs through ingestion at the same average rate at which they cease to be identifiable through digestion.
  3. The mass digestion rate scales as prey mass to the power 2/32/3(Jobling 1981; Bromley 1994; Andersen 1999).
  4. The prey community experienced by the predator has number density proportional to w−λw^{-\lambda}.
  5. Other effects on detectability and stomach residence time do not introduce an additional systematic prey-size dependence.

These assumptions are a modeling choice, not information recovered from the stomach data. The resulting kernel should be interpreted and tested with that uncertainty in mind.

Ingestion

Let w′w' be predator mass, ww prey mass, and l=log(w′/w)l=\log(w'/w). Write the rate density at which a predator ingests prey of mass ww as

I(w∣w′)=i(w′)ϕ(w′/w)Nc(w). I(w\mid w') = i(w')\,\phi(w'/w)\,N_c(w).

Here ϕ\phi is the feeding-kernel shape, Nc(w)N_c(w) is the number density of available prey, and i(w′)i(w') contains factors that depend on predator mass but not prey mass. In a multispecies model, NcN_c can include species interaction strengths:

Nc(w)=∑jθijNj(w). N_c(w)=\sum_j\theta_{ij}N_j(w).

The historical prey field experienced by sampled predators is rarely known. The package approximates it by a power-law resource spectrum,

Nc(w)=ncw−λ. N_c(w)=n_c w^{-\lambda}.

For a mizer model, λ\lambda is read from mizer::resource_params(params)$lambda; it is not fixed at two by the package.

Digestion and stomach residence

If prey mass is digested at a rate proportional to w2/3w^{2/3} and prey remains identifiable until a fixed fraction has been digested, identifiable residence time scales as w1/3w^{1/3}. The corresponding disappearance rate is

D(w)=dw−1/3. D(w)=d w^{-1/3}.

Let Nw(w∣w′)N_w(w\mid w') be the stomach prey-number density. The steady-state balance assumption is

I(w∣w′)=D(w)Nw(w∣w′). I(w\mid w')=D(w)N_w(w\mid w').

Substitution gives

i(w′)ϕ(w′/w)ncw−λ=dw−1/3Nw(w∣w′), i(w')\phi(w'/w)n_cw^{-\lambda} =d w^{-1/3}N_w(w\mid w'),

and hence, up to factors independent of prey mass,

ϕ(w′/w)∝wλ−1/3Nw(w∣w′). \phi(w'/w)\propto w^{\lambda-1/3}N_w(w\mid w').

Express the result on the log-PPMR scale

Let f0(l)f_0(l) be the number-weighted probability density of identifiable stomach prey. The change of variables derived in vignette("density_functions") gives

f0(l)∝wNw(w∣w′),Nw(w∣w′)∝f0(l)w. f_0(l)\propto w N_w(w\mid w'), \qquad N_w(w\mid w')\propto \frac{f_0(l)}{w}.

Therefore

ϕ(w′/w)∝wλ−4/3f0(l)∝e−(λ−4/3)lf0(l). \phi(w'/w) \propto w^{\lambda-4/3}f_0(l) \propto e^{-(\lambda-4/3)l}f_0(l).

In the package’s weighting notation, the kernel shape is the stomach distribution represented at

qmizer=λ−43. q_{mizer}=\lambda-\frac{4}{3}.

This is exactly the target power used internally by set_kernel_params(). A fit can have been estimated at any recorded power; transform_fit() moves it from that power to qmizerq_{mizer} before model parameters are set.

Consequences for fitted families

Suppose a fit was estimated at exponent q0q_0 and let a=qmizer−q0a=q_{mizer}-q_0.

For a normal distribution,

μkernel=μfit−aσ2,σkernel=σ. \mu_{kernel}=\mu_{fit}-a\sigma^2, \qquad \sigma_{kernel}=\sigma.

mizer represents this as a "lognormal" kernel with beta = exp(mu_kernel) and sigma = sigma_kernel.

For a smoothly truncated exponential,

αkernel=αfit−a, \alpha_{kernel}=\alpha_{fit}-a,

while the two cutoff locations and steepnesses are unchanged. mizer represents this as a "power_law" kernel using its five kernel_* columns.

For a Gaussian mixture, the component means and proportions are transformed as described in vignette("density_functions"). mizer represents the result as a "gaussian_mixture" kernel, storing the transformed component vectors in the list-columns kernel_p, kernel_mean, and kernel_sd.

Worked mizer example

We fit the Atlantic cod diet distribution at power = 2/3. The North Sea example model calls this species "Cod", so the fit must be renamed before it is transferred.

cod_fit <- fit_log_ppmr(
  barnes_data,
  species = "Atlantic cod",
  distribution = "normal",
  power = 2 / 3
)
cod_fit
#>                  mean       sd      species distribution     power min_w_pred
#> Atlantic cod 3.443057 1.276434 Atlantic cod       normal 0.6666667          0

The model’s resource exponent determines the exact kernel weighting:

params <- mizer::NS_params
kernel_power <- mizer::resource_params(params)$lambda - 4 / 3
kernel_power
#> [1] 0.8
transform_fit(cod_fit, power = kernel_power)
#>                  mean       sd      species distribution power min_w_pred
#> Atlantic cod 3.225819 1.276434 Atlantic cod       normal   0.8          0

set_kernel_params() performs that transformation itself. Only species present in the supplied fit are changed, and the returned object must be assigned.

model_cod_fit <- cod_fit
model_cod_fit$species <- "Cod"
rownames(model_cod_fit) <- "Cod"

params <- set_kernel_params(params, model_cod_fit)
subset(
  mizer::species_params(params),
  species == "Cod",
  select = c(species, pred_kernel_type, beta, sigma)
)
#> An object of class "species_params" containing parameters for 1 species:
#>  species pred_kernel_type     beta    sigma
#>      Cod        lognormal 25.17419 1.276434

Extract and inspect existing kernels

extract_fit() reverses the parameter mapping and returns distributions at power = 0. This allows existing model kernels to be inspected with plot_log_ppmr_fit(), evaluated with get_density(), or transformed to another weighting.

model_fits <- extract_fit(params)
model_fits["Cod", c("species", "distribution", "power", "mean", "sd")]
#>     species distribution power     mean       sd
#> Cod     Cod       normal     0 4.529247 1.276434

cod_diet_again <- transform_fit(
  model_fits["Cod", , drop = FALSE],
  power = 2 / 3
)
cod_diet_again[c("power", "mean", "sd")]
#>         power     mean       sd
#> Cod 0.6666667 3.443057 1.276434

extract_fit() accepts species_dict when model and stomach-data names need to be reconciled in the opposite direction.

cod_from_model <- extract_fit(
  params,
  species_dict = c(Cod = "Atlantic cod")
)
cod_from_model["Atlantic cod", c("species", "distribution", "power")]
#>                   species distribution power
#> Atlantic cod Atlantic cod       normal     0

Interpretation and sensitivity

The fitted kernel is conditional on the assumed prey spectrum and digestion scaling. In particular:

  • changing λ\lambda changes the exponential tilt and therefore the kernel mean or slope;
  • size-dependent prey availability can be mistaken for predator preference;
  • digestion and identification rates may not follow one allometry for all prey types;
  • pooled stomach observations can mix different prey fields and predator behaviors; and
  • a good fit to stomach densities does not validate the resulting population dynamics.

Treat the transferred parameters as empirically informed starting values. Evaluate them with the other evidence available for the predator and with mizer model diagnostics or calibration. Exact parameter mappings and error conditions are documented in ?set_kernel_params and ?extract_fit.

References

Andersen, Niels G. 1999. “The Effects of Predator Size, Temperature, and Prey Characteristics on Gastric Evacuation in Whiting.” Journal of Fish Biology 54 (2): 287–301.
Bromley, PJ. 1994. “The Role of Gastric Evacuation Experiments in Quantifying the Feeding Rates of Predatory Fish.” Reviews in Fish Biology and Fisheries 4 (1): 36–66.
Jobling, Malcolm. 1981. “Mathematical Models of Gastric Emptying and the Estimation of Daily Rates of Food Consumption for Fish.” Journal of Fish Biology 19 (3): 245–57.
Scott, Finlay, Julia L Blanchard, and Ken H Andersen. 2014. “Mizer: An r Package for Multispecies, Trait-Based and Community Size Spectrum Ecological Modelling.” Methods in Ecology and Evolution 5 (10): 1121–25.