LeMansParam: A constructor for the 'LeMansParam' class

Description Usage Arguments Details Value See Also Examples

Description

A constructor for the LeMansParam class.

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
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 nfish rows and the following columns: Linf, W_a, W_b, k and Lmat. See below for definitions of each of these parameters.

gdf

A data frame with nfish rows and the following columns: curve, catch_species, max_catchability, k and gear_name. See below for definitions of each of these parameters.

...

Additional arguments for calculating catchability curves. See calc_Q for more details.

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 1e12.

bounds

An optional argument specifying the bounds of the length classes.

calc_phi_min

A logical statement indicating whether phi_min should be calculated within the function. The default is FALSE.

phi_min

A fixed numeric value of phi_min, which represents the time step of the model. This parameter is only required if calc_phi_min=FALSE. The default is 0.1.

vary_growth

A logical statement indicating whether growth efficiency should vary for each species (vary_growth=TRUE) or be fixed at the value given by fixed_growth (vary_growth=FALSE). The default is TRUE.

growth_eff

If vary_growth==TRUE, growth_eff is a numeric representing the growth efficiencies of a fish of length 0. If vary_growth==FALSE, growth_eff is a numeric value of length 1 representing a fixed growth efficiency for all fish. The default is 0.5.

growth_eff_decay

A numeric value specifying the rate at which growth efficiency decreases as length increases to Linf. The default is 0.11.

eps

A numeric value specifying a numerical offset. The default value is 1e-5.

force_mature

A logical statement indicating whether to force maturity for all fish in the largest length class. The default is TRUE.

species_names

A numeric or character vector of length nfish that denotes the names of the species in the model.

kappa

A numeric vector of length nfish representing the rate of change from immature to mature fish.

tau

A matrix with dimensions nfish and nsc. Row indices represent predators and column indices represent prey. A value of 1 at location i, j indicates prey j is eaten by predator i.

rec_fun

A character vector representing the stock recruitment function to be applied to each species. The default value is "hockey-stick" but rec_fun can take a value of "Ricker", "Beverton-Holt", "constant", or "linear" for each species.

recruit_params

A list object of length nfish specifying the parameters for the recruitment function.

natmort_opt

A character vector of length 1 describing the mortality function to be used for the species. The default value is "std_RNM" but can take a value of "constant" or "linear". See calc_M1 for more information.

Nmort

A numeric vector of length nfish representing the maximum background mortality of each species. The default is 0.8 for all species.

prop

A numeric vector of length nfish representing the proportion of length classes that have a non-zero background mortality. This is required only when the natmort_opt mortality function is used. The default is 3/4.

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, curve is a character vector of length nfish that takes the value "logistic" in each element, but it can also take a value of "log-gaussian" or "knife-edge". If a custom curve is required for a particular species and/or fishing gear, the curve must be specified in custom.

catch_species

A numeric value or character string describing the species to apply the catchability curve to.

max_catchability

A numeric vector of length curve describing the maximum catchability for each catchability curve.

gear_name

A character vector of the same length as curve and species describing the fishing gear that each element of curve and species relates to. By default, gear_name is a character vector of length curve that takes the value paste("gear_", 1:length(curve), sep = "").

custom

An array with dimensions nsc, nfish and the number of custom catchability curves that are required. custom represents the catchability of each species by the gears specified using custom catchability curves. By default, custom is set to NULL.

Linf

A numeric vector of length nfish representing the mid-point of the length classes.

k

k A numeric vector of length nfish representing the von Bertalanffy growth parameter (1/yr) for each species.

W_a

A numeric vector representing the parameter a in the length-weight conversion.

W_b

A numeric vector representing the parameter b in the length-weight conversion.

Lmat

A numeric vector of length nsc representing the length at which 50% of the individuals are mature.

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

run_LeMans, LeMans_param

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)

LeMaRns documentation built on Dec. 9, 2019, 5:09 p.m.