Learn R Programming

mizer (version 1.0.1)

getPredRate: Get predation rate

Description

Calculates the predation rate of each predator species at size on prey size. In formulas $$\int\phi_i(w_p/w) (1-f_i(w)) \gamma_i w^q N_i(w) dw$$ This method is used by the project method for performing simulations. In the simulations, it is combined with the interaction matrix (see MizerParams) to calculate the realised predation mortality (see getM2).

Usage

getPredRate(object, n, n_pp, feeding_level)

# S4 method for MizerParams,matrix,numeric,matrix getPredRate(object, n, n_pp, feeding_level)

# S4 method for MizerParams,matrix,numeric,missing getPredRate(object, n, n_pp)

Arguments

object

A MizerParams object.

n

A matrix of species abundance (species x size).

n_pp

A vector of the background abundance by size.

feeding_level

The current feeding level (optional). A matrix of size no. species x no. size bins. If not supplied, is calculated internally using the getFeedingLevel() method.

Value

A two dimensional array (predator species x prey size), where the prey size runs over community plus background spectrum.

See Also

project, getM2, getFeedingLevel and MizerParams

Examples

Run this code
# NOT RUN {
data(NS_species_params_gears)
data(inter)
params <- MizerParams(NS_species_params_gears, inter)
# With constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get the feeding level at one time step
n <- sim@n[21,,]
n_pp <- sim@n_pp[21,]
getPredRate(params,n,n_pp)
# }

Run the code above in your browser using DataLab