Skip to contents

Optimizes k, L_inf, d, m, and annuli_min_age using nlminb(). Spawning parameters and annuli_date are treated as data.

Usage

fit_tmb_nll(
  surveys,
  Delta_l = 1,
  Delta_t = 0.05,
  spawning_mu,
  spawning_kappa,
  annuli_date,
  start,
  lower = c(k = 1e-06, L_inf = 0.001, d = 1e-06, m = 1e-06, annuli_min_age = 0),
  upper = c(k = Inf, L_inf = Inf, d = Inf, m = Inf, annuli_min_age = 5),
  compile = TRUE
)

Arguments

surveys

Data frame with columns survey_date (numeric), Length, K, count.

Delta_l

Numeric size step (cm), default 1.

Delta_t

Numeric time step (years), default 0.05.

spawning_mu

Spawning mean date in [0,1).

spawning_kappa

Spawning concentration parameter.

annuli_date

Annual ring formation date in [0,1).

start

Named numeric vector for parameters c(k, L_inf, d, m, annuli_min_age).

lower

Named numeric vector of lower bounds (same names).

upper

Named numeric vector of upper bounds (same names).

compile

Logical, compile the TMB template if needed.

Value

A list with optimizer result, sdreport, obj, and data used.