getM2Background method for the size based model

Share:

Description

Calculates the predation mortality on the background spectrum by prey size. Used by the project method for running size based simulations.

Arguments

object

A MizerParams object.

n

A matrix of species abundance (species x size).

n_pp

A vector of the background abundance by size.

pred_rate

An array of predation rates of dimension no. sp x no. community size bins x no. of size bins in whole spectra (i.e. community + background, the w_full slot). The array is optional. If it is not provided it is calculated by the getPredRate() method.

Value

A vector of predation mortalities by background prey size.

See Also

project and getM2.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 M2 of the background spectrum at one time step
n <- sim@n[21,,]
n_pp <- sim@n_pp[21,]
getM2Background(params,n,n_pp)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.