salmon_sim: Simulation of Larkin population dynamics model

View source: R/salmon_sim.R

salmon_simR Documentation

Simulation of Larkin population dynamics model

Description

Simulates Larkin population dynamics model, based on Appendix F of Holt et al. 2018/011 Res Doc (and what's in our draft manuscript), Ricker Appendix, and Grant 2010/042 Res. Doc. Notation matches that of our write up. The harvest rate has to be prescribed for all years, and to initialize the model the recruitment R_t has to be given for the first eight years. All parameters must be >=0, some >0. Units of recruits and spawners are nominally millions of fish, and is the only absolute scale because the beta_i sum to 1. Simulation runs for a transient time of 'T_transient' years and then saves ouputs values for the next 'T' years.

Usage

salmon_sim(
  alpha = 7,
  beta = c(0.25, 0.25, 0.25, 0.25),
  p_prime = c(0.003, 0.917, 0.08),
  rho = 0,
  omega = 0.4,
  sigma_nu = 1,
  nu_t = NULL,
  phi_1 = 0,
  T = 80,
  T_transient = 100,
  h_t = NULL,
  R_t_init = c(25, 5, 1, 1, 25.01, 5.02, 1.01, 1.02) * 0.05,
  epsilon_tg = NULL,
  deterministic = FALSE,
  extirp = 2e-06
)

Arguments

alpha

Number or vector of length (T+T_transient), where each element is the annual ratio of recruits to spawners at low spawner abundance in the absence of noise.

beta

Vector [beta_0, beta_1, beta_2, beta_3] that scales the relative magnitude of density dependence based on the current spawning stock (beta_0) and the previous three years (beta_1, beta_2 and beta_3), with beta_0 + beta_1 + beta_2 + beta_3 = 1. Setting beta_1 = beta_2 = beta_3 = 0 reduces the model to a Ricker model. Be aware that 'beta[1]' in code is $beta_0$ from the write up.

p_prime

Vector of typical proportion of recruits spawned in a year that will come back to freshwater as age-3, age-4 and age-5 (each of three elements in the vector, which must sum to 1).

rho

Autocorrelation parameter for process noise, >= 0.

omega

Scales the annual normal deviates on the proportions returning at each age. If omega = 0 then there is no stochasticity for the proportions (and if 'deterministic = 0' then 'omega' is set to 0.

sigma_nu

Standard deviation of process noise. If sigma_nu = 0 and rho = 0 then no process noise. Ignored if 'nu_t' specified.

nu_t

Explicit specification of the process noise term to allow reproducible simulations when testing different methods (see 'epsilon_tg' also). Must be a numeric vector of length 'T + T_transient', can have negative values. If not specified then a default is created.

phi_1

Initial value of process noise.

T

Number of years of the simulation to return.

T_transient

Number of years to first run the model for a transient time; for later fitting using the 'T' years from '(T_transient + 1):(T_transient + T)'. Total time includes the eight years needed for initialising the simulation, so 'T_transient + T' must be >=9.

h_t

Vector of harvest rate for each year 1, 2, 3, ..., 'T_transient'. Or if a single value then this will be the constant rate for all years. If NULL then harvest rate will be set to 0.2 for all years.

R_t_init

Vector of eight years of recruit abundance to initialize the model.

epsilon_tg

Specified matrix of random variation in the 'p_tg'. Must be of dimension 'T_transient * length(p_prime)' (returns error if not), where 'length(p_prime) = 3' for the default. Each column of 'epsilon_tg' corresponds to the respective element of 'p_prime', so column 1 refers to age-3, etc (see equations in write up). For running multiple simulations, this overall setup will allow seeds to be specified and thus specific values of stochasticity to be explicitly input as the matrix 'epsilon_tg' (so they can be the same when testing different models). Experience tells us this should be clearer than creating the stochasticity within this function. If 'epsilon_tg' is not specified then a default is created (which obviously depends on the seed). This is ignored if 'deterministic' is TRUE.

deterministic

If TRUE then include no stochasticity and any given values of rho, omega, sigma_nu, phi_1, nu_t, and epsilon_tg are redundant and set to 0 (nu_t is just ignored).

extirp

Value below which we consider the population extirpated, in same units as recruits and spawners (so if those are assumed to change, this value should be changed also).

Value

Tibble of years (rows) with named columns: t: year, covering the non-transient years; R_t: total recruits returning in year t; R_prime_t: number of adult recruits generated from spawners in year t that will return to freshwater (and then be subject to fishing and can then spawn); S_t: number of fish that spawn in year t; h_t: harvest rate in year t; p_t3, p_t4, p_t5: proportion of R_prime in year t that later returned at age 3, 4 and 5; epsilon_t3, epsilon_t4, epsilon_t5: realised stochastic variation in the epsilons phi_t: realised stochastic variation in 'phi_t' alpha: alpha productivity values, since we now allow the option for time-varying


andrew-edwards/EDMsimulate documentation built on Oct. 25, 2023, 2:43 p.m.