Learn R Programming

mizer (version 3.4.0)

summary_functions: Description of summary functions

Description

Mizer provides a range of functions to summarise the results of a simulation.

Arguments

Writing your own summary function

The entry point is sizeIntegral(). It selects the size range, applies the bin-averaging appropriate to the model's second_order_w() setting and wraps the result in the right mizer array class, so a summary function built on it is automatically consistent with the quadrature the model is actually using. Pass the whole weighting factor \(K(w)\) evaluated on the size grid, but neither the bin widths params@dw nor any bin-averaging of your own: sizeIntegral() supplies both.

If your quantity involves the predation kernel, take the kernel from encounter_kernel() rather than from pred_kernel(), and pair it with the plain point prey weight params@w_full * params@dw_full. That weight is a normalisation which the kernel construction is built to cancel, not a quadrature weight, so it is the one place where you must not bin-average. Pairing the point-sampled pred_kernel() with a bin-averaged prey weight applies the prey-bin integral twice.

Details

A list of available summary functions is given in the table below.

FunctionReturnsDescription
getDiet()Three dimensional array (predator x size x prey)Diet of predator at size, resolved by prey species
getTrophicLevel()ArraySpeciesBySize (species x size)Trophic level of individuals at size, accounting for ontogenetic diet shifts
getTrophicLevelBySpecies()Named vector (species)Consumption-rate-weighted mean trophic level of each species
getSSB()Two dimensional array (time x species)Total Spawning Stock Biomass (SSB) of each species through time where SSB is calculated as the sum of weight of all mature individuals.
getBiomass()Two dimensional array (time x species)Total biomass of each species through time.
getN()Two dimensional array (time x species)Total abundance of each species through time.
getFeedingLevel()Three dimensional array (time x species x size)Feeding level of each species by size through time.
getM2Three dimensional array (time x species x size)The predation mortality imposed on each species by size through time.
getFMort()Three dimensional array (time x species x size)Total fishing mortality on each species by size through time.
getFMortGear()Four dimensional array (time x gear x species x size)Fishing mortality on each species by each gear at size through time.
getYieldGear()Three dimensional array (time x gear x species)Total yield by gear and species through time.
getYield()Two dimensional array (time x species)Total yield of each species across all gears through time.
sizeIntegral()Named vector (species) or two dimensional array (time x species)Any integral over the size spectrum, from which all of the above are built. Use it to write your own summary function.

See Also

indicator_functions, plotting_functions