LeMansParam {LeMaRns} | R Documentation |
A constructor for the LeMansParam
class
Description
A constructor for the LeMansParam
class.
Usage
LeMansParam(df, gdf, ...)
## S4 method for signature 'ANY,ANY'
LeMansParam(
df,
gdf,
nfish = nrow(df),
nsc = 32,
pred_mu = -2.25,
pred_sigma = 0.5,
other = 1e+12,
bounds = NULL,
calc_phi_min = FALSE,
phi_min = 0.1,
vary_growth = TRUE,
growth_eff = 0.5,
growth_eff_decay = 0.11,
eps = 1e-05,
force_mature = TRUE,
species_names = paste("species", 1:nfish, sep = "_"),
kappa = rep(10, nfish),
tau = matrix(1, nfish, nfish),
rec_fun = rep("hockey-stick", nfish),
recruit_params = list(a = 18.835 - 4.133 * df$Linf, b = rep(1000/nfish, nfish)),
natmort_opt = rep("std_RNM", nfish),
Nmort = rep(0.8, nfish),
prop = rep(3/4, nfish),
curve = rep("logistic", nfish),
catch_species = ((0:(length(curve) - 1))%%nfish) + 1,
max_catchability = rep(1, length(curve)),
gear_name = paste("gear_", 1:length(curve), sep = ""),
custom = NULL,
...
)
## S4 method for signature 'missing,ANY'
LeMansParam(
gdf,
nfish = length(Linf),
nsc = 32,
pred_mu = -2.25,
pred_sigma = 0.5,
other = 1e+12,
bounds = NULL,
calc_phi_min = FALSE,
phi_min = 0.1,
vary_growth = FALSE,
growth_eff = 0.5,
growth_eff_decay = 0.11,
eps = 1e-05,
force_mature = TRUE,
Linf,
k,
W_a,
W_b,
Lmat,
species_names = paste("species", 1:nfish, sep = "_"),
kappa = rep(10, nfish),
tau = matrix(1, nfish, nfish),
rec_fun = rep("hockey-stick", nfish),
recruit_params = list(a = 18.835 - 4.133 * Linf, b = rep(1000/nfish, nfish)),
natmort_opt = rep("std_RNM", nfish),
Nmort = rep(0.8, nfish),
prop = rep(3/4, nfish),
curve = rep("logistic", nfish),
catch_species = ((0:(length(curve) - 1))%%nfish) + 1,
max_catchability = rep(1, length(curve)),
gear_name = paste("gear_", 1:length(curve), sep = ""),
custom = NULL,
...
)
## S4 method for signature 'missing,missing'
LeMansParam(
df,
gdf,
nfish = length(Linf),
nsc = 32,
pred_mu = -2.25,
pred_sigma = 0.5,
other = 1e+12,
bounds = NULL,
calc_phi_min = TRUE,
phi_min = 0.1,
vary_growth = FALSE,
growth_eff = 0.5,
growth_eff_decay = 0.11,
eps = 1e-05,
force_mature = TRUE,
species_names = paste("species", 1:nfish, sep = "_"),
Linf,
k,
W_a,
W_b,
Lmat,
kappa = rep(10, nfish),
tau = matrix(1, nfish, nfish),
rec_fun = rep("hockey-stick", nfish),
recruit_params = list(a = 18.835 - 4.133 * Linf, b = rep(1000/nfish, nfish)),
natmort_opt = rep("std_RNM", nfish),
Nmort = rep(0.8, nfish),
prop = rep(3/4, nfish),
curve = rep("logistic", nfish),
catch_species = ((0:(length(curve) - 1))%%nfish) + 1,
max_catchability = rep(1, length(curve)),
gear_name = paste("gear_", 1:length(curve), sep = ""),
custom = NULL,
...
)
Arguments
df |
A data frame with |
gdf |
A data frame with |
... |
Additional arguments for calculating catchability curves. See |
nfish |
A numeric value representing the number of fish species in the model. |
nsc |
A numeric value representing the number of length classes in the model. |
pred_mu |
A numeric value representing the preferred predator-prey mass ratio. |
pred_sigma |
A numeric value representing the width of the weight preference function. |
other |
A numeric value representing the amount of other food (g) available from prey that is not explicitly represented in the model. The default is |
bounds |
An optional argument specifying the bounds of the length classes. |
calc_phi_min |
A logical statement indicating whether |
phi_min |
A fixed numeric value of |
vary_growth |
A logical statement indicating whether growth efficiency should vary for each species ( |
growth_eff |
If |
growth_eff_decay |
A numeric value specifying the rate at which growth efficiency decreases as length increases to |
eps |
A numeric value specifying a numerical offset. The default value is |
force_mature |
A logical statement indicating whether to force maturity for all fish in the largest length class. The default is |
species_names |
A numeric or character vector of length |
kappa |
A numeric vector of length |
tau |
A matrix with dimensions |
rec_fun |
A character vector representing the stock recruitment function to be applied to each species. The default value is |
recruit_params |
A list object of length |
natmort_opt |
A character vector of length |
Nmort |
A numeric vector of length |
prop |
A numeric vector of length |
curve |
A character vector of almost any length describing the type of curve to be used to determine the catchability of each species by fishing gear. By default, |
catch_species |
A numeric value or character string describing the species to apply the catchability curve to. |
max_catchability |
A numeric vector of length |
gear_name |
A character vector of the same length as |
custom |
An array with dimensions |
Linf |
A numeric vector of length |
k |
k A numeric vector of length |
W_a |
A numeric vector representing the parameter |
W_b |
A numeric vector representing the parameter |
Lmat |
A numeric vector of length |
Details
Converts objects of class data frame or vector to class LeMansParams for use in the LeMans model. Linf
, W_a
, W_b
, k
and Lmat
are required as either a data frame or as vectors.
Value
An object of class LeMansParam
for use in the LeMans model.
See Also
Examples
# To run the model with all inputs specified explicitly:
# Set up species-specific parameters
Linf <- NS_par$Linf # the von-Bertalanffy asymptotic length of each species (cm).
W_a <- NS_par$W_a # length-weight conversion parameter.
W_b <- NS_par$W_b # length-weight conversion parameter.
k <- NS_par$k # the von-Bertalnaffy growth parameter.
Lmat <- NS_par$Lmat # the length at which 50% of individuals are mature (cm).
NS_params <- LeMansParam(species_names=NS_par$species_names, Linf=Linf, k=k, W_a=W_a, W_b=W_b,
Lmat=Lmat, tau=NS_tau, recruit_params=list(a=NS_par$a, b=NS_par$b), eta=rep(0.25, 21), L50=Lmat,
other=NS_other)
###############################################
# Alternatively:
NS_params <- LeMansParam(NS_par, tau=NS_tau, eta=rep(0.25, 21), L50=NS_par$Lmat, other=NS_other)