Calculates the potential rate (in units 1/year) at which a prey individual of
a given size \(w\) is killed by predators from species \(j\). In formulas
$${\tt pred\_rate}_j(w_p) = \int \phi_j(w,w_p) (1-f_j(w))
\gamma_j(w) N_j(w) \, dw.$$
This potential rate is used in getPredMort() to
calculate the realised predation mortality rate on the prey individual.
Arguments
- object
A MizerParams or MizerSim object.
- ...
Additional arguments that depend on the class of
object.For a MizerParams object:
nA matrix of species abundances (species x size). Defaults to the initial abundances stored in
object.n_ppA vector of the resource abundance by size. Defaults to the initial resource abundance stored in
object.n_otherA named list of the abundances of other dynamical components. Defaults to the initial values stored in
object.tThe time for which to do the calculation. Defaults to 0.
For a MizerSim object:
time_rangeThe time range over which to return the rates. Either a vector of values, a vector of min and max time, or a single value. Defaults to the whole time range of the simulation.
dropIf
TRUEthen any dimension of length 1 is removed from the returned array.
Value
MizerParams: AnArraySpeciesBySizeobject (predator species x prey size), where the prey size runs over fish community plus resource spectrum.MizerSim: AnArrayTimeBySpeciesBySizeobject (time step x predator species x prey size) with the predation rates at every time step. Ifdrop = TRUEthen dimensions of length 1 will be removed.
Your own predation rate function
By default getPredRate() calls mizerPredRate(). However you can
replace this with your own alternative predation rate function. If
your function is called "myPredRate" then you register it in a MizerParams
object params with
Your function will then be called instead of mizerPredRate(), with
the same arguments.
See also
Other rate functions:
getDiffusion(),
getEGrowth(),
getERepro(),
getEReproAndGrowth(),
getEncounter(),
getFMort(),
getFMortGear(),
getFeedingLevel(),
getFlux(),
getMort(),
getPredMort(),
getRDD(),
getRDI(),
getRates(),
getResourceMort()
Examples
# \donttest{
params <- NS_params
# Predation rate in initial state
pred_rate <- getPredRate(params)
str(pred_rate)
#> 'ArraySpeciesBySize' num [1:12, 1:226] 8.35e-17 6.05e-10 9.75e-16 1.19e-05 1.04e-17 ...
#> - attr(*, "dimnames")=List of 2
#> ..$ sp : chr [1:12] "Sprat" "Sandeel" "N.pout" "Herring" ...
#> ..$ w_prey: chr [1:226] "2.12e-13" "2.53e-13" "3.02e-13" "3.61e-13" ...
#> - attr(*, "value_name")= chr "Predation rate"
#> - attr(*, "units")= chr "1/year"
#> - attr(*, "params")=Formal class 'MizerParams' [package "mizer"] with 46 slots
# 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
pred_rate <- getPredRate(params, n = N(sim)[15, , ],
n_pp = NResource(sim)[15, ], t = 15)
# }
