pop_dynamics: Population Dynamics

View source: R/pop_dynamics.R

pop_dynamicsR Documentation

Population Dynamics

Description

pop_dynamics returns updated values for fishing mortality, numbers at age, abundance of all and mature individuals, biomass, and spawning stock biomass in a specific area, at a specific time step, under a specific control rule

Usage

pop_dynamics(
  t,
  cr,
  fdr,
  Rec_age,
  Max_age,
  SSB,
  N,
  W,
  Mat,
  A = 5,
  Fb,
  E,
  S,
  FM,
  A50_mat,
  Biomass,
  Abundance,
  Fishing = T,
  Nat_mortality,
  R,
  Ind_sampled = "all"
)

Arguments

t

temporary numeric value, the current time step.

cr

temporary numeric value, the current control rule.

fdr

temporary numeric value, the current final target density ratio.

Rec_age

numeric value, the age at recruitment, in years.

Max_age

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

SSB

numeric array, the spawning stock biomass of the whole stock for each area, at each timestep, under each control rule, and for each estimate of natural mortality.

N

numeric array, the number of individuals at each age, in each area, at each timestep, under each control rule, and for each estimate of natural mortality.

W

numeric vector, the estimated weight at age from age at recruitment to maximum age, in kg.

Mat

numeric vector, the estimated fraction of individuals mature at each age, from age at recruitment to maximum age, on the interval (0, 1).

A

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

Fb

numeric value, the historical fishing effort for the fished species.

E

numeric array, the relative fishing effort displayed in each area, at each time step, under each control rule, and for each natural mortality estimate.

S

numeric vector, the selectivities at age from age at recruitment to maximum age, on the interval (0, 1).

FM

numeric array that corresponds to the fishing mortality at each age in each area, at each timestep, under all control rules, with all estimates of natural mortality.

A50_mat

numeric value, the first age at which 50% or more individuals are estimated to be mature. on the interval (Rec_age, Max_age).

Biomass

numeric array, the total biomass in each area, at each time step, under all control rules, with all estimates of natural mortality, in kg.

Abundance

numeric array, the total number of all and/or mature individuals in each area, at each timestep, under all control rules, with all estimates of natural mortality.

Fishing

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

Nat_mortality

numeric vector, the estimates of natural mortality.

R

numeric vector, the estimated recruits coming into each area at the current time step, under the current control rule, and with the current estimate of natural mortality.

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'.

Value

numeric arrays, with updated values of fishing mortality (FM), numbers at age (N), Abundance, Biomass, and spawning stock biomass (SSB).

Examples

n = 34; A = 5; TimeT = 70; CR = 6; FDR = 4
SSB <- array(rep(548, A*TimeT*CR*FDR), c(A, TimeT, CR, FDR))
Biomass <- array(rep(568, A*TimeT*CR*FDR), c(A, TimeT, CR, FDR))
Abundance <- array(rep(3400, A*TimeT*CR*FDR*1), c(A, TimeT, CR, FDR, 1))
N <- array(rep(10, n*A*TimeT*CR*FDR), c(n, A, TimeT, CR, FDR))
FM <- array(rep(0.2, n*A*TimeT*CR*FDR), c(n, A, TimeT, CR, FDR))
L <- length_age(Rec_age = 2, Max_age = 35, A1 = 5, L1 = 32.21, A2 = 15,
   L2 = 47.95, K = 0.2022, All_ages = FALSE)
W <- weight(L, WA = 1.68e-5, WB = 3)
Mat <- maturity(Rec_age = 2, Max_age = 35, K_mat = -0.4103, L, L50 = 39.53)
E <- array(rep(1, A*TimeT*CR*FDR), c(A, TimeT, CR, FDR))
S <- selectivity(Rec_age = 2, Max_age = 35, A1 = 5, L1 = 32.21, A2 = 15,
   L2 = 47.95, K = 0.2022, Fleets = c('sport', 'hook', 'trawl'),
   A50_up = c(2, 5, 10), A50_down = c(6, 16, 35), Alpha = c(0.33, 0.6, 0.64),
   F_fin = c(0.25, 0.06, 1), Beta = c(1.2, 0.6, 0), Cf = c(0.71, 0.28, 0.01))
NuR <- array(rnorm(A*TimeT*CR*FDR, 0, 0.5), c(A, TimeT, CR, FDR))
Eps <- epsilon(A, TimeT, CR, FDR, NuR, Rho_R = 0)
R <- recruitment(t = 3, cr = 1, fdr = 1, SSB, A, R0 = 1e+5,
   H = 0.65, B0 = 1e+5/1.1, Eps, Sigma_R = 0.5, Rec_age = 2,
   Recruitment_mode = 'pool', LDP = 0.1)
pop_dynamics(t = 3, cr = 1, fdr = 1, Rec_age = 2, Max_age = 35, SSB,
   N, W, Mat, A, Fb = 0.2, E, S, FM, A50_mat = 8, Biomass,
   Abundance, Fishing = TRUE, Nat_mortality = c(0.14, 0.09, 0.19), R,
   Ind_sampled = 'all')

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