Performs a root finding routine to find the index of F that minimizes the difference between observed catch and the value predicted by the Baranov equation.
calc_F(
Cobs,
N,
sel,
wt,
M,
q_fs,
delta = 1,
na = dim(N)[1],
nr = dim(N)[2],
ns = dim(N)[3],
nf = length(Cobs),
Fmax = 2,
nitF = 5L,
trans = c("log", "logit")
)A list containing:
F_afrs Fishing mortality array
F_ars Fishing mortality array (summed across fleets)
Z_ars Total mortality array
F_index Index of fishing mortality. Matrix [f, r]
CB_frs Catch (biomass) array
CN_afrs Catch (abundance) array
VB_afrs Vulnerable biomass at the beginning of the time step. Array
penalty Penalty term returned by posfun() when F_index exceeds Fmax
fn Difference between predicted and observed catch at the last iteration. Matrix [f, r]
gr Gradient of fn with respect to F_index in either log or logit space at the last iteration. Vector by [f, r]
Observed catch. Matrix [f, r]
Stock abundance at the beginning of the time step. Array [a, r, s]
Selectivity. Array [a, f, s]
Fishery weight at age. Array [a, f, s]
Instantaneous natural mortality. Units of per year [a, s]
Relative catchability of stock s for fleet f. Defaults to 1 if missing. Matrix [f, s]
Numeric, the duration of time in years corresponding to the observed catch, e.g., 0.25 is a quarterly time step.
Integer, number of age classes
Integer, number of regions
Integer, number of stocks
Integer, number of fleets
Numeric, the maximum Findex value
Integer, number of iterations for the Newton-Raphson routine
Whether to perform the search in log or logit space
Q. Huynh
The predicted catch for fleet f in region r is
$$
C^{\textrm{pred}}_{f,r} = \sum_s \sum_a v_{a,f,s} q_{f,s} F_{f,r} \dfrac{1 - \exp(-Z_{a,r,s})}{Z_{a,r,s}} N_{a,r,s} w_{a,f,s}
$$
The Newton-Raphson routine minimizes \(f(x_{f,r}) = C_{f,r}^{\textrm{pred}} - C_{f,r}^{\textrm{obs}}\).
If trans = "log", \(F_{f,r} = \exp(x_{f,r})\).
If trans = "logit", \(F_{f,r} = F_{\textrm{max}}/(1 + \exp(x_{f,r}))\).
The gradient with respect to \(\vec{x}\) is $$ f'(x_{f,r}) = \sum_s \sum_a v_{a,f,s} q_{f,s} N_{a,r,s} w_{a,f,s} \left(\dfrac{\alpha\gamma}{\beta}\right)' $$
$$ \left(\dfrac{\alpha\gamma}{\beta}\right)' = \dfrac{(\alpha\gamma' + \alpha'\gamma)\beta - \alpha\gamma\beta'}{\beta^2} $$
where
| \(\alpha_{f,r} = F_{f,r}\) |
| \(\beta_{a,r,s} = Z_{a,r,s} = M_{a,s} + \sum_f v_{a,f,s} q_{f,s} F_{f,r}\) |
| \(\gamma_{a,r,s} = 1 - \exp(-Z_{a,r,s})\) |
| \(\beta'_{a,f,r,s} = v_{a,f} q_{f,s} \alpha'_{f,r}\) |
| \(\gamma'_{a,f,r,s} = \exp(-Z_{a,r,s})\beta'_{a,f,r,s}\) |
If trans = "log", \(\alpha'_{f,r} = \alpha_{f,r}\).
If trans = "logit", \(\alpha'_{f,r} = F_{\textrm{max}}\exp(-x_{f,r})/(1 + \exp(-x_{f,r}))^2\).
This function solves for \(\vec{x}\) by iterating until \(f(\vec{x})\) approaches zero, where the vector arrow indexes over fleet and region. In iteration \(i+1\): $$\vec{x}_{i+1} = \vec{x}_i - \dfrac{f(\vec{x}_i)}{f'(\vec{x}_i)}$$.