getM2Background: getM2Background method for the size based model

getM2BackgroundR Documentation

getM2Background method for the size based model

Description

Calculates the predation mortality \mu_p(w) on the background spectrum by prey size. Used by the project_therMizer method for running size based simulations.

getM2Background method with pred_array argument.

Usage

getM2Background(object, n, n_pp, pred_rate)

## S4 method for signature 'therMizerParams,matrix,numeric,array'
getM2Background(object, n,
  n_pp, pred_rate)

Arguments

object

A MizerParams_therMizer 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.

ocean_temp

A numeric vector of the ocean temperature by realm or a single numeric ocean_temp value which is used for all realms.

Value

A vector of predation mortalities by background prey size.

See Also

project_therMizer and getM2.

Examples

## Not run: 
data(NS_species_params_gears)
data(inter)
params <- therMizerParams(NS_species_params_gears, inter)
# With constant fishing effort for all gears for 20 time steps
sim <- project_therMizer(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)

pwoodworth-jefcoats/Size-Based-Modeling documentation built on Sept. 15, 2023, 8:13 a.m.