Creating a new model

Mizer allows the easy set-up of three different types of models, of increasing levels of complexity. See https://sizespectrum.org/mizer/dev/articles/mizer.html#size-spectrum-models for a description of these model types.

newCommunityParams()

Set up parameters for a community-type model

newTraitParams()

Set up parameters for a trait-based model

newMultispeciesParams()

Set up parameters for a general multispecies model

Model parameters

Even after you have created a model, you can still make changes with the following functions. This is useful while tuning the model and for investigating the impact of changes in parameters.

species_params() `species_params<-`()

Species parameters

gear_params() `gear_params<-`()

Gear parameters

setParams()

Set or change any model parameters

setPredKernel()

Set predation kernel

getPredKernel()

Get predation kernel

setSearchVolume() getSearchVolume()

Set search volume

setInteraction() getInteraction()

Set species interaction matrix

setMaxIntakeRate() getMaxIntakeRate()

Set maximum intake rate

setMetabolicRate() getMetabolicRate()

Set metabolic rate

setExtMort() getExtMort()

Set external mortality rate

setReproduction() getMaturityProportion() getReproductionProportion()

Set reproduction parameters

setFishing() getCatchability() getSelectivity() getInitialEffort()

Set fishing parameters

setResource() getResourceRate() getResourceCapacity() getResourceDynamics()

Set up resource

resource_params() `resource_params<-`()

Resource parameters

setInitialValues()

Set initial values to final values of a simulation

setBevertonHolt()

Set Beverton-Holt density dependence

Running simulations

project()

Project size spectrum forward in time

`initialN<-`() initialN()

Initial values for fish spectra

`initialNResource<-`() initialNResource()

Initial value for resource spectrum

setInitialValues()

Set initial values to final values of a simulation

steady()

Set initial values to a steady state for the model

Accessing results

N() NResource()

Time series of size spectra

finalN() finalNResource()

Size spectra at end of simulation

idxFinalT()

Time index at end of simulation

getEffort()

Fishing effort used in simulation

getTimes()

Times for which simulation results are available

Analysing results

summary_functions

Description of summary functions

getDiet()

Get diet of predator at size, resolved by prey species

getBiomass()

Calculate the total biomass of each species within a size range at each time step.

getN()

Calculate the number of individuals within a size range

getSSB()

Calculate the SSB of species

getYield()

Calculate the total yield of each species

getYieldGear()

Calculate the total yield per gear and species

getGrowthCurves()

Get growth curves giving weight as a function of age

Calculating indicators

indicator_functions

Description of indicator functions

getProportionOfLargeFish()

Calculate the proportion of large fish

getCommunitySlope()

Calculate the slope of the community abundance

getMeanWeight()

Calculate the mean weight of the community

getMeanMaxWeight()

Calculate the mean maximum weight of the community

Plotting results

plotting_functions

Description of the plotting functions

plotBiomass() plotlyBiomass()

Plot the biomass of species through time

plotDiet()

Plot diet

plotFMort() plotlyFMort()

Plot total fishing mortality of each species by size

plotFeedingLevel() plotlyFeedingLevel()

Plot the feeding level of species by size

plotGrowthCurves() plotlyGrowthCurves()

Plot growth curves giving weight as a function of age

plot(<MizerSim>,<missing>) plot(<MizerParams>,<missing>)

Summary plot for MizerSim objects

plotPredMort() plotlyPredMort()

Plot predation mortality rate of each species against size

plotSpectra() plotlySpectra()

Plot the abundance spectra

plotYield() plotlyYield()

Plot the total yield of species through time

plotYieldGear() plotlyYieldGear()

Plot the total yield of each species by gear through time

setColours() getColours()

Set line colours to be used in mizer plots

setLinetypes() getLinetypes()

Set linetypes to be used in mizer plots

Calculating rates

getRates()

Get all rates

getEncounter()

Get encounter rate

getEGrowth()

Get energy rate available for growth

getERepro()

Get energy rate available for reproduction

getEReproAndGrowth()

Get energy rate available for reproduction and growth

getFMort()

Get the total fishing mortality rate from all fishing gears by time, species and size.

getFMortGear()

Get the fishing mortality by time, gear, species and size

getFeedingLevel()

Get feeding level

getCriticalFeedingLevel()

Get critical feeding level

getMort()

Get total mortality rate

getResourceMort()

Get predation mortality rate for resource

getPredMort()

Get total predation mortality rate

getPredRate()

Get predation rate

getRDD()

Get density dependent reproduction rate

getRDI()

Get density independent rate of egg production

Extending Mizer

setRateFunction() getRateFunction() other_params() `other_params<-`()

Set own rate function to replace mizer rate function

setComponent() removeComponent()

Add a dynamical ecosystem component

getComponent()

Get information about other ecosystem components

`initialNOther<-`() initialNOther()

Initial values for other ecosystem components

NOther()

Time series of other components

finalNOther()

Values of other ecosystem components at end of simulation

Predation kernels

lognormal_pred_kernel()

Lognormal predation kernel

box_pred_kernel()

Box predation kernel

power_law_pred_kernel()

Power-law predation kernel

truncated_lognormal_pred_kernel()

Truncated lognormal predation kernel

Fishing selectivity functions

knife_edge()

Weight based knife-edge selectivity function

sigmoid_length()

Length based sigmoid selectivity function

sigmoid_weight()

Weight based sigmoidal selectivity function

double_sigmoid_length()

Length based double-sigmoid selectivity function

Resource dynamics

resource_semichemostat()

Project resource using semichemostat model

resource_constant()

Keep resource abundance constant

Density-dependent reproduction

BevertonHoltRDD()

Beverton Holt function to calculate density-dependent reproduction rate

RickerRDD()

Ricker function to calculate density-dependent reproduction rate

SheperdRDD()

Sheperd function to calculate density-dependent reproduction rate

noRDD()

Give density-independent reproduction rate

constantRDD()

Give constant reproduction rate

Internal rate functions

These functions are used by project() to calculate instantaneous rates at each time step. You should use the get…() functions instead of the mizer…() functions.

mizerRates()

Get all rates needed to project standard mizer model

mizerEGrowth()

Get energy rate available for growth needed to project standard mizer model

mizerERepro()

Get energy rate available for reproduction needed to project standard mizer model

mizerEReproAndGrowth()

Get energy rate available for reproduction and growth needed to project standard mizer model

mizerEncounter()

Get encounter rate needed to project standard mizer model

mizerFMort()

Get the total fishing mortality rate from all fishing gears by time, species and size needed to project standard mizer model

mizerFMortGear()

Get the fishing mortality by time, gear, species and size needed to project standard mizer model

mizerFeedingLevel()

Get feeding level needed to project standard mizer model

mizerMort()

Get total mortality rate needed to project standard mizer model

mizerPredMort()

Get total predation mortality rate needed to project standard mizer model

mizerPredRate()

Get predation rate needed to project standard mizer model

mizerRDI()

Get density-independent rate of reproduction needed to project standard mizer model

mizerResourceMort()

Get predation mortality rate for resource needed to project standard mizer model

Internal helper functions

validSpeciesParams()

Validate species parameter data frame

validGearParams()

Check validity of gear parameters and set defaults

set_species_param_default()

Set a species parameter to a default value

get_h_default()

Get default value for h

get_gamma_default()

Get default value for gamma

get_ks_default()

Get default value for ks

get_phi()

Get values from feeding kernel function

log_breaks()

Helper function to produce nice breaks on logarithmic axes

get_initial_n()

Calculate initial population abundances for the community populations

retune_erepro()

Retune reproduction efficiency to maintain initial egg abundances

get_required_reproduction()

Determine reproduction rate needed for initial egg abundance

emptyParams()

Create empty MizerParams object of the right size

project_simple()

Project abundances by a given number of time steps into the future

Classes

MizerParams-class

A class to hold the parameters for a size based model.

summary(<MizerParams>)

Summarize MizerParams object

w() w_full() dw() dw_full()

Size bins

validParams()

Validate MizerParams object and upgrade if necessary

upgradeParams()

Upgrade MizerParams object from earlier mizer versions

MizerSim-class

A class to hold the results of a simulation

summary(<MizerSim>)

Summarize MizerSim object

upgradeSim()

Upgrade MizerSim object from earlier mizer versions

MizerSim()

Constructor for the MizerSim class

getParams()

Extract the parameter object underlying a simulation

Example parameter sets

More example parameter sets are available via https://sizespectrum.org/mizerExamples

NS_params

Example MizerParams object for the North Sea example

NS_species_params

Example species parameter set based on the North Sea

NS_species_params_gears

Example species parameter set based on the North Sea with different gears

inter

Example interaction matrix for the North Sea example

Deprecated

These functions are available for backwards compatibility with earlier versions of mizer

set_multispecies_model()

Deprecated obsolete function for setting up multispecies parameters

set_community_model()

Deprecated function for setting up parameters for a community-type model

set_trait_model()

Deprecated function for setting up parameters for a trait-based model

MizerParams()

Alias for set_multispecies_model

getESpawning()

Alias for getERepro

getPhiPrey()

Get available energy

getM2()

Alias for getPredMort

getM2Background()

Alias for getResourceMort

getZ()

Alias for getMort

plotM2()

Alias for plotPredMort