initialize_arrays: Initialize arrays

View source: R/initialize_arrays.R

initialize_arraysR Documentation

Initialize arrays

Description

initialize_arrays returns arrays necessary for other functions in the base model: TimeT (total time the model runs), L (length at age), W (weight at age), S (selectivity at age), Mat (maturity at age), A50_mat (the first age at which 50% or more of individuals are expected to be mature), CR (number of control rules to be compared), Nat_mortality (values of estimated natural mortality), N (numbers at age array), SSB (spawning stock biomass array), Abundance (abundance of all/mature individuals array), Eps (recruitment error), B0 (unfished biomass), Count (estimated counts based on sampling array), Sigma_S (sampling random variable standard deviation), NuS (sampling random variable), Delta (constant of proportionality), Gamma, FM (fishing mortality), E (effort), Catch, Yield, Rel_Biomass (relative biomass after reserve implementation), Rel_yield (relative yield after reserve implementation), Rel_SSB (relative spawning stock biomass after reserve implementation), Density_ratio.

Usage

initialize_arrays(
  A = 5,
  MPA = 3,
  Final_DRs,
  Time1 = 50,
  Time2 = 20,
  R0 = 1e+05,
  Rec_age,
  Max_age,
  A1,
  L1,
  A2,
  L2,
  K,
  WA,
  WB,
  K_mat,
  Fb,
  L50,
  Sigma_R,
  Rho_R = 0,
  Fleets,
  Alpha,
  A50_up,
  A50_down,
  F_fin,
  Beta,
  Cf,
  P,
  X,
  SP,
  M,
  Recruitment_Var = TRUE,
  D,
  Transects = 24,
  H,
  Surveys = TRUE,
  Fishing = TRUE,
  M_Error,
  Sampling_Var = TRUE,
  Recruitment_mode = "pool",
  LDP = 0.1,
  Ind_sampled = "all",
  BM = FALSE
)

Arguments

A

numeric value, the number of total areas in the model. Default value is 5.

MPA

numeric value, the area number to be designated as a marine reserve at Time1. Default value is 3.

Final_DRs

numeric vector, the final target density ratios.

Time1

numeric value, the number of years to run the model before a marine reserve is implemented. Default value is 50.

Time2

numeric value, the number of years to run the model after a marine reserve is implemented. Default value is 20.

R0

numeric value, the unfished recruitment, set arbitrarily. Default value is 1e+5.

Rec_age

numeric value, the age at recruitment, in years.

Max_age

numeric value, the maximum age of fish or total lifespan, in years.

A1

numeric value, age 1 of female fish, in years.

L1

numeric value, the length of females at age 1, in cm.

A2

numeric value, age 2 of female fish, in years.

L2

numeric value, the length of females at age 2, in cm.

K

numeric value, the von Bertalanffy growth parameter for females.

WA

numeric value, the coefficient in the weight at length equation.

WB

numeric value, the exponent in the weight at length equation.

K_mat

numeric value, the slope of the maturity curve.

Fb

numeric value, the historical fishing effort for the fished species on the interval (0, 1).

L50

numeric value, the length at 50% maturity, in cm.

Sigma_R

numeric value, the recruitment standard deviation.

Rho_R

numeric value, the recruitment autocorrelation on the interval (-1, 1). Default value is 0.

Fleets

character vector, the names of all fishing fleets that contribute to selectivity at age on the interval (0, 1).

Alpha

numeric vector, the alpha values for each fishing fleet in Fleets on the interval (0, 1), gives the relative slope of the upcurve.

A50_up

numeric vector, the age values at which selectivity is equal to 0.5 for the upcurve each fishing fleet in Fleets on the interval (0, 1).

A50_down

numeric vector, the age values at which selectivity is equal to 0.5 for the downcurve each fishing fleet in Fleets on the interval (0, 1).

F_fin

numeric vector, the final selectivity values for fleets on the interval (0, 1).

Beta

numeric vector, the beta values for each fishing fleet in Fleets on the interval (0, 1), gives the relative slope of the downcurve if dome-shaped.

Cf

numeric vector, the fraction of the whole fishery represented by each fleet.

P

numeric value, the proportion of positive transects during sampling.

X

numeric value, the average value of individuals seen during positive transects.

SP

numeric value, the standard deviation of individuals seen during positive transects.

M

numeric value, the natural mortality on the interval (0, 1).

Recruitment_Var

logical vector, does recruitment contain a stochastic component? Default value is TRUE.

D

numeric value, the current depletion of the stock, on the interval (0, 1).

Transects

numerical value, the number of sampling transects conducted in each area to estimate density ratio. Default value is 24.

H

numeric value, the steepness of the stock-recruitment curve.

Surveys

logical value, are surveys being conducted? Default value is TRUE.

Fishing

logical value, is fishing occurring? Default value is TRUE.

M_Error

numeric value, the error between estimated and correct natural mortality.

Sampling_Var

logical value, is there any error in sampling? Default value is TRUE.

Recruitment_mode

character value, values can be: 'closed' - the recruits in each area originate from adults in that area. 'pool' - the recruits in each area come from a pool of larvae produced by adults in all areas. 'regional_DD' - larvae experience regional density dependence before settling evenly across all areas 'local_DD' - larvae experience local density dependence before settling evely across all areas Default value is 'pool'.

LDP

numeric value, the larval drift proportion, the proportion of larvae that drift from one area to an adjacent area before settling. Default value is 0.1.

Ind_sampled

character value, the individuals to be sampled to calculate density ratio. Values can be: 'all' - sample all individuals. 'mature' - sample only mature individuals. Default value is 'all'.

BM

logical value, are the control rules from Babcock and MacCall 2011? Default value is FALSE.

Value

initalizes arrays necessary for other functions in the base model, including Inside, Outside, FDR, TimeT, L, W, S, Mat, A50_mat, CR, Nat_mortality, N, SSB, Biomass, Eps, B0, Count, Sigma_S, NuS, Delta, Gamma, FM, E, Catch, Yield, Density_ratio, Abundance

Examples

initialize_arrays(A = 5,  MPA = 3, Final_DRs = c(0.2), Time1 = 50,
   Time2 = 20, R0 = 1e+5, Rec_age = 2, Max_age = 35, A1 = 5, L1 = 32.21,
   A2 = 15, L2 = 47.95, K = 0.2022, WA = 1.68e-5, WB = 3, K_mat = -0.4103,
   Fb = 0.2, L50 = 39.53, Sigma_R = 0.5, Rho_R = 0,
   Fleets = c('sport', 'hook', 'trawl'), Alpha = c(0.33, 0.6, 0.64),
   A50_up = c(2, 5, 10), A50_down = c(6, 16, 35), F_fin = c(0.25, 0.06, 1),
   Beta = c(1.2, 0.6, 0), Cf = c(0.71, 0.28, 0.01), P = 0.77, X = 15.42,
   SP = 16.97, M = 0.14, Recruitment_Var = TRUE, D = 0.488, Transects = 24,
   H = 0.65, Surveys = TRUE, Fishing = TRUE, M_Error = 0.05,
   Sampling_Var = TRUE, Recruitment_mode = 'pool', LDP = 0.1,
   Ind_sampled = 'all', BM = FALSE)

vquennessen/densityratio documentation built on Aug. 28, 2022, 5:36 p.m.