# NOT RUN {
# Set up the inputs to the function
nfish <- nrow(NS_par)
nsc <- 32
maxsize <- max(NS_par$Linf)*1.01 # the biggest size is 1% bigger than the largest Linf
l_bound <- seq(0, maxsize, maxsize/nsc); l_bound <- l_bound[-length(l_bound)]
u_bound <- seq(maxsize/nsc, maxsize, maxsize/nsc)
mid <- l_bound+(u_bound-l_bound)/2
# Set up the inputs to the function - species-specific parameters
Linf <- NS_par$Linf # the von-Bertalanffy asymptotic length of each species (cm).
W_a <- NS_par$W_a # length-weight conversion parameter.
W_b <- NS_par$W_b # length-weight conversion parameter.
k <- NS_par$k # the von-Bertalnaffy growth parameter.
Lmat <- NS_par$Lmat # the length at which 50\% of individuals are mature (cm).
# Calculate gear catchability
Qs <- calc_Q(curve=rep("logistic", nfish), species=NS_par$species_names,
max_catchability=rep(1, nfish), gear_name=NS_par$species_names,
nsc=nsc, nfish=nfish, mid=mid, l_bound=l_bound, u_bound=u_bound,
species_names=NS_par$species_names, eta=rep(0.25, nfish), L50=Lmat)
# Calculate logistic catchability for the first species
logistic_catch(species=1, nsc, nfish, mid, eps=1e-5,L50=Lmat[1], eta=0.25)
# Calculate log-gaussian catchability for the first species
log_gaussian_catch(species=1, nsc, nfish, mid, eps=1e-5, Lmu=50, Lsigma=1)
# Calculate knife-edge catchability for the first species
knife_edge_catch(species=1, nsc, nfish, l_bound, u_bound, Lmin=50)
# }
Run the code above in your browser using DataLab