project()
.validGearParams()
handle NAs more gracefully and check that there are no duplicates.upgradeParams()
works also on params objects that were created with a development version of mizer.upgradeParams()
does a better job at guessing the value for w_pp_cutoff
.getFeedingLevel()
, getPredMort()
, setInitialValues()
and steady()
now work also when model has extra components.plotFeedinglevel()
when called with include_critical = TRUE
, see #162.species_params
is a tibble.params()
, effort()
and times()
to getParams()
, getEffort()
and getTimes()
to avoid conflicts.getDiet()
also takes into account possible contributions by user-defined other components.project()
is called with t_max < t_save
then t_save
is automatically reduced so that the result at t_max
will get saved.project()
.project_simple()
that projects a given number of time steps. This might be useful to extension writers....
argument to project()
is passed on to the dynamics and rate functions.steady()
runs faster by using project_simple()
.summary()
now also works with non-default feeding kernels. #159validSpeciesParams()
no longer fails when w_mat25
is not specified. #160setInitialValues()
also works in a model with only a single species. #161resource_params()<-
now works and has unit tests.Some inconsistencies in the choice of names for parameters was removed by renaming
interaction_p
-> interaction_resource
r_resource
-> resource_rate
K_resource
-> resource_capacity
other_params()<-
and other_params()
for setting and getting other parameters, for example to be used in user-defined rate functions.setInitialValues()
also sets initial_effort
. #157This is a major new release with many new features, an internal refactoring of the code and a new extension mechanism.
Nevertheless this version of mizer is almost fully backwards compatible with version 1.0 with the exception of bug fixes and the following breaking changes:
print_it
argument from plot functions.all.sizes = TRUE
.RDD
argument in setReproduction()
.sex_ratio
argument has been removed from getRDI()
and getRDD()
.set_scaling_model()
function has been removed because such models can now be set up with newTraitParams()
with the options perfect_scaling = TRUE
and egg_size_scaling = TRUE
.display_frames()
, addSpecies()
, setBackground()
and retuneAbundance()
have been removed to the “mizerExperimental” package (https://sizespectrum.org/mizerExperimental)project()
a progress bar is displayed by default. You can turn this off with the option `progress_bar = FALSE.The new functions
newCommunityParams()
newTraitParams()
newMultispeciesParams()
replace the old functions set_community_model()
, set_trait_model()
and MizerParams()
, which are now deprecated. The new functions choose better default values, in particular for metabolic rate and maximum intake rate.
After setting up a mizer model, it is possible to change specific model parameters with the new functions
species_params<-()
resource_params<-()
gear_params<-()
setPredKernel()
setSearchVolume()
setInteraction()
setMaxIntakeRate()
setMetabolicRate()
setExtMort()
setReproduction()
setFishing()
setResource()
The new function setParams()
is a wrapper for all of the above functions and is also used when setting up a new model with newMultispeciesParams()
. (#51)
The documentation for these functions serves to explain the details of the mizer model.
Along with these setter functions there are accessor functions for getting the parameter arrays: getPredKernel()
, getSearchVolume()
, getInteraction()
, getMaxIntakeRate()
, getMetabolicRate()
, getExtMort()
, getMaturityProportion()
, getReproductionProportion()
, getCatchability()
, getSelectivity()
, getResourceRate()
, getResourceCapacity()
, getResourceParams()
, getResourceDynamics()
,
setRmax()
.The MizerParams object now also contains the initial values for the size spectra. This is particularly useful if the model has been tuned to produce the observed steady state. The new function steady()
finds a steady state for a model and sets it as the initial value. The initial values can be accessed and changed via functions initialN()
and initialNResource()
. The initial values can be set to the final values of a previous simulation with setInitialValues()
.
The MizerParams object now has a slot initial_effort
that specifies the initial fishing effort to which the steady state has been calibrated.
Mizer now has an extension mechanism that allows other R packages to be written to generalise the mizer model. See setRateFunction()
and setComponent()
. This mechanism is still experimental and may change as we gain experience in writing extensions for mizer.
plotlyBiomass()
as the plotly version of plotBiomass()
, and so on.plotGrowthCurves()
plots growth curves and compares them to the von Bertalanffy growth curve.plotDiet()
plots the diet composition as a function of predator size.highlight
argument to all plot functions that display curves for multiple species. Displays highlighted species with wider lines.plot()
method for MizerParams object to plot the initial state.include_critical
in plotFeedingLevel()
allows to show also the critical feeding level.wlim
argument to plotSpectra()
in analogy to the existing ylim
argument to limit the w range in the plot.setColours()
.solid
but this can be changed via the setLinetypes()
function.box_pred_kernel()
implements a box-shaped kernel as an alternative to the default lognormal_pred_kernel()
.power_law_pred_kernel()
implements a power-law kernel with sigmoidal cutoffs at both ends. This is suitable for filter feeders.setPredKernel()
). Mizer automatically falls back on the old non-FFT code to handle this. (#41)getPredKernel()
returns the full 3-dimensional predation kernel array, even when this is not stored in MizerParams object.Now it is finally possible to have several gears (or fleets) targeting the same species. The information is set up via a new gear_params()
data frame. See setFishing()
for details.
w()
, w_full()
, dw()
, dw_full()
.upgradeParams()
and upgradeSim()
can upgrade objects from previous versions of mizer so they work with the new version.getDiet()
calculates the diet of predators. (#43)RickerRDD()
and SheperdRDD()
for density-dependence in reproduction, as well as noRDD()
and constantRDD()
.double_sigmoid_length()
allows modelling of escape of large individuals.sigmoidal_weight()
is weight-based trawl selectivity function. (Ken H Andersen)getGrowthCurves()
calculates the growth curves (size at age).mizerRates()
calculates all the rates needed in the model and collects them in a list.times()
to extract the times at which simulation results are saved in a MizerSim object.finalN()
, finalNResource()
and finalNOther()
as well as idxFinalT()
to access the values at the final time of a simulation.getCriticalFeedingLevel()
returns the critical feeding level for each species at each size.melt()
function from the reshape2 package which allows users to convert the arrays returned by mizer functions into data frames that can be used for example in ggplot2 and plotly.validSpeciesParams()
checks validity of species parameter data frame and sets defaults for missing but required parameters.n
, p
and q
as well as the feeding level f0
can now be set at the species level via columns in species_params
.fc
can now be specified as a species parameter and will be used to calculate the metabolic rate parameter ks
if it is not supplied.project()
now shows a progress bar while a simulation is running. Can be turned off with progress_bar = FALSE
argument.Inf
.resource_semichemostat()
.interaction_resource
column in the species parameter data frame.w_mat25
column in the species parameter dataframe, which gives the size at which 25% of the individuals of a species are mature.m
column in the species parameter data frame.project()
can now continue projection from last time step of a previous simulation if the first argument is a MizerSim object. The new append
argument then controls whether the new results are appended to the old.newMultispeciesParams()
.n
, n_pp
and n_other
arguments from the initial values in the params
argument.perfect_scaling
argument allows newTraitParams()
to produce a perfectly scale-invariant model.ext_mort_prop
argument in newTraitParams()
allows the inclusion of external mortality.NS_params
with the North Sea model MizerParams object.newMultispeciesParams()
.getmM2()
-> getPredMort()
plotM2
-> plotPredMort()
getM2background()
-> getResourceMort()
getZ()
-> getMort()
getESpawning()
-> getERepro()
MizerParams()
-> emptyParams()
or set_multispecies_model()
r_max
to R_max
.getSSB()
, the calculation of the spawning stock biomass is done correctly using the maturity ogive instead of the proportion of energy allocated to reproduction. (#47)getEncounter()
and getPredRate()
now set names on the returned arrays.ylim
argument is not handled correctly in plots.display_frame()
is now exported.summary()
of MizerParams object reflects the number of non-empty resource bins. (@patricksykes)get_gamma_default()
, get_h_default()
and get_ks_default()
, making it easier to change or extend these in the future.set_species_param_default()
makes it easier to set default values for species parameters.@inherit
functionality of roxygen2 to reduce duplication in roxygen documentation.getPhiPrey()
is replaced by getEncounter()
which now returns the full encounter rate, including the contribution from other components. Even in the absence of other components, getEncounter()
differs from the old getPhiPrey()
because it includes the search volume factor.params
to refer to an argument of class MizerParams, sim
to refer to an argument of class MizerSim, and object
to an argument that can be either.setClass()
to follow the new guidelines, replacing representation
by class
and removing prototype
and validity
.shiny_progress
renamed to progress_bar
because they control any type of progress bar.outer()
instead of tapply()
where possible to improve readability.hasArg()
and anyNA()
because they were not available in R 3.1@std_metab
and @activity
slots into a single @metab
slot.@w_min_idx
out of @species_params
into its own slot.@maturity
to hold the maturity ogive.@pred_kernel
to hold predation kernel if it has variable predator/prey ratio.@resource_dynamics
to allow user to specify alternative resource dynamics.@gear_dynamics
to species to be targeted by multiple gears.@ft_mask
that is used when calculating predation rates using the Fourier transform method.@rates_funcs
to allow mizer extensions to replace mizer rate functions with their own rate functions.@srr
we now have the name of the function in @rate_funcs$RDD
, see #91.@other_dynamics
, @other_params
, @other_encounter
, @other_mort
and @initial_n_other
to allow mizer extensions to add more ecosystem components.set_scaling_model()
, see section 12 in the vignette.PlotYield()
no longer fails when species names are numbers or when a species abundance is zerototal
parameter to several plot functions to add the curve for the total community (sum over all species and resource)species
parameter to all plot functions to allow for only a selection of species to be plotted@initial_n
and @initial_n_pp
slots to MizerParams class.getPhiPrey()
and getPredRate()
.getPhiPrey()
and getPredRate()
.