Package index
Creating a new model
Mizer allows the easy set-up of four different types of models, of increasing level of complexity. See https://sizespectrum.org/mizer/articles/mizer.html#size-spectrum-models for a description of these model types.
-
newSingleSpeciesParams()
experimental - Set up parameters for a single species in a power-law background
-
newCommunityParams()
- Set up parameters for a community-type model
-
newTraitParams()
- Set up parameters for a trait-based multispecies model
-
newMultispeciesParams()
- Set up parameters for a general multispecies model
-
mizer
mizer-package
- mizer: Multi-species size-based modelling in R
-
defaults_edition()
- Default editions
Changing model parameters
After you have created a model, you will want to make changes to it while tuning the model and for investigating the impact of changes in parameters.
-
species_params()
`species_params<-`()
given_species_params()
`given_species_params<-`()
calculated_species_params()
- Species parameters
-
gear_params()
`gear_params<-`()
- Gear parameters
-
`initialN<-`()
initialN()
- Initial values for fish spectra
-
`initialNResource<-`()
initialNResource()
- Initial value for resource spectrum
-
initial_effort()
`initial_effort<-`()
validEffortVector()
- Initial fishing effort
Steady state tuning
The first task after creating a multi-species model is to tune the model parameters so that in its steady state the model reproduces average observed growth rates, abundances and fisheries yields.
-
steady()
- Set initial values to a steady state for the model
-
steadySingleSpecies()
experimental - Set initial abundances to single-species steady state abundances
-
matchGrowth()
- Adjust model to produce observed growth
-
plotBiomassObservedVsModel()
plotlyBiomassObservedVsModel()
experimental - Plotting observed vs. model biomass data
-
calibrateBiomass()
experimental - Calibrate the model scale to match total observed biomass
-
calibrateNumber()
experimental - Calibrate the model scale to match total observed number
-
matchBiomasses()
experimental - Match biomasses to observations
-
matchNumbers()
experimental - Match numbers to observations
-
plotYieldObservedVsModel()
plotlyYieldObservedVsModel()
experimental - Plotting observed vs. model yields
-
scaleModel()
experimental - Change scale of the model
Dynamics tuning
After tuning the steady state, you need to tune the sensitivity of the dynamics to perturbations away from the steady state. The following functions allow you to change the model without destroying the steady state.
-
setBevertonHolt()
experimental - Set Beverton-Holt reproduction without changing the steady state
-
setMetadata()
getMetadata()
experimental - Set metadata for a model
-
saveParams()
readParams()
experimental - Save a MizerParams object to file, and restore it
-
project()
- Project size spectrum forward in time
-
projectToSteady()
experimental - Project to steady state
-
setInitialValues()
- Set initial values to values from a simulation
-
N()
NResource()
- Time series of size spectra
-
finalN()
finalNResource()
idxFinalT()
- Size spectra at end of simulation
-
getEffort()
- Fishing effort used in simulation
-
getTimes()
- Times for which simulation results are available
-
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 rate at which biomass of each species is fished
-
getYieldGear()
- Calculate the rate at which biomass of each species is fished by each gear
-
getGrowthCurves()
- Get growth curves giving weight as a function of age
-
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_functions
- Description of the plotting functions
-
animateSpectra()
experimental - Animation of the abundance spectra
-
plot(<MizerParams>,<missing>)
- Summary plot for
MizerParams
objects
-
plotBiomass()
plotlyBiomass()
- Plot the biomass of species through time
-
plotBiomassObservedVsModel()
plotlyBiomassObservedVsModel()
experimental - Plotting observed vs. model biomass data
-
plotDiet()
experimental - Plot diet, resolved by prey species, as function of predator at size.
-
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
-
plot(<MizerSim>,<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
-
plotYieldObservedVsModel()
plotlyYieldObservedVsModel()
experimental - Plotting observed vs. model yields
-
setColours()
getColours()
setLinetypes()
getLinetypes()
experimental - Set line colours and line types to be used in mizer plots
-
addSpecies()
experimental - Add new species
-
removeSpecies()
experimental - Remove species
-
renameSpecies()
experimental - Rename species
Setting custom rates
You can override the rates mizer calculates from the species parameters and gear parameters with your own rate arrays.
-
setParams()
- Set or change any model parameters
-
setPredKernel()
getPredKernel()
pred_kernel()
`pred_kernel<-`()
- Set predation kernel
-
setSearchVolume()
getSearchVolume()
search_vol()
`search_vol<-`()
- Set search volume
-
setInteraction()
interaction_matrix()
`interaction_matrix<-`()
- Set species interaction matrix
-
setMaxIntakeRate()
getMaxIntakeRate()
intake_max()
`intake_max<-`()
- Set maximum intake rate
-
setMetabolicRate()
getMetabolicRate()
metab()
`metab<-`()
- Set metabolic rate
-
setExtMort()
getExtMort()
ext_mort()
`ext_mort<-`()
- Set external mortality rate
-
setExtEncounter()
getExtEncounter()
ext_encounter()
`ext_encounter<-`()
- Set external encounter rate
-
setReproduction()
getMaturityProportion()
maturity()
`maturity<-`()
getReproductionProportion()
repro_prop()
`repro_prop<-`()
- Set reproduction parameters
-
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
-
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
-
customFunction()
experimental - Replace a mizer function with a custom version
-
box_pred_kernel()
- Box predation kernel
-
lognormal_pred_kernel()
- Lognormal predation kernel
-
power_law_pred_kernel()
- Power-law predation kernel
-
truncated_lognormal_pred_kernel()
- Truncated lognormal predation kernel
-
double_sigmoid_length()
- Length based double-sigmoid selectivity function
-
knife_edge()
- Weight based knife-edge selectivity function
-
sigmoid_length()
- Length based sigmoid selectivity function
-
sigmoid_weight()
- Weight based sigmoidal selectivity function
-
resource_constant()
- Keep resource abundance constant
-
resource_logistic()
balance_resource_logistic()
- Project resource using logistic model
-
resource_semichemostat()
balance_resource_semichemostat()
- Project resource using semichemostat model
-
setResource()
resource_rate()
`resource_rate<-`()
resource_capacity()
`resource_capacity<-`()
resource_level()
`resource_level<-`()
resource_dynamics()
`resource_dynamics<-`()
- Set resource dynamics
-
resource_params()
`resource_params<-`()
- Resource parameters
-
BevertonHoltRDD()
- Beverton Holt function to calculate density-dependent reproduction rate
-
RickerRDD()
experimental - Ricker function to calculate density-dependent reproduction rate
-
SheperdRDD()
experimental - Sheperd function to calculate density-dependent reproduction rate
-
constantEggRDI()
experimental - Choose egg production to keep egg density constant
-
constantRDD()
experimental - Give constant reproduction rate
-
noRDD()
- Give density-independent reproduction rate
-
getReproductionLevel()
experimental - Get reproduction level
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
-
mizerFMortGear()
- Get the fishing mortality 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
-
age_mat()
- Calculate age at maturity
-
age_mat_vB()
- Calculate age at maturity from von Bertalanffy growth parameters
-
calc_selectivity()
- Calculate selectivity from gear parameters
-
constant_other()
- Helper function to keep other components constant
-
default_pred_kernel_params()
- Set defaults for predation kernel parameters
-
different()
- Check whether two objects are different
-
distanceMaxRelRDI()
experimental - Measure distance between current and previous state in terms of RDI
-
distanceSSLogN()
experimental - Measure distance between current and previous state in terms of fish abundances
-
emptyParams()
- Create empty MizerParams object of the right size
-
get_f0_default()
- Get default value for f0
-
get_gamma_default()
- Get default value for gamma
-
get_initial_n()
- Calculate initial population abundances
-
get_ks_default()
- Get default value for
ks
-
get_phi()
- Get values from feeding kernel function
-
get_required_reproduction()
- Determine reproduction rate needed for initial egg abundance
-
get_size_range_array()
- Get size range array
-
get_time_elements()
- Get_time_elements
-
needs_upgrading()
- Determine whether a MizerParams or MizerSim object needs to be upgraded
-
project_simple()
- Project abundances by a given number of time steps into the future
-
set_species_param_default()
- Set a species parameter to a default value
-
validGearParams()
- Check validity of gear parameters and set defaults
-
validSpeciesParams()
validGivenSpeciesParams()
- Validate species parameter data frame
-
valid_gears_arg()
- Helper function to assure validity of gears argument
-
valid_species_arg()
- Helper function to assure validity of species argument
-
MizerParams-class
- A class to hold the parameters for a size based model.
-
summary(<MizerParams>)
- Summarize MizerParams object
-
compareParams()
experimental - Compare two MizerParams objects and print out differences
-
validParams()
- Validate MizerParams object and upgrade if necessary
-
MizerSim-class
- A class to hold the results of a simulation
-
summary(<MizerSim>)
- Summarize MizerSim object
-
validSim()
- Validate MizerSim object and upgrade if necessary
-
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
-
NS_interaction
- Example interaction matrix for the North Sea example
-
NS_sim
- Example MizerSim object for the North Sea example
-
MizerParams()
deprecated - Alias for
set_multispecies_model()
-
calibrateYield()
deprecated - Calibrate the model scale to match total observed yield
-
completeSpeciesParams()
deprecated - Alias for
validSpeciesParams()
-
getESpawning()
deprecated - Alias for
getERepro()
-
getM2()
deprecated - Alias for
getPredMort()
-
getM2Background()
deprecated - Alias for
getResourceMort()
-
getPhiPrey()
deprecated - Get available energy
-
inter
deprecated - Alias for
NS_interaction
-
matchYields()
deprecated - Match yields to observations
-
plotM2()
deprecated - Alias for
plotPredMort()
-
setRmax()
deprecated - Alias for
setBevertonHolt()
-
set_community_model()
deprecated - Deprecated function for setting up parameters for a community-type model
-
set_multispecies_model()
deprecated - Deprecated obsolete function for setting up multispecies parameters
-
set_trait_model()
deprecated - Deprecated function for setting up parameters for a trait-based model