setwd("C:/flrpapers/erp_nea_mackerel/Rmd")
The Operating Model is based on the ICES stock assessment. All coding is done using R [@R] and FLR [@kell2007flr] in Rmarkdown [@Rmdbook], and summarised in as vignettes. The information (data, files, etc.) required to re-do the analysis, is available at ???, including the ICES assessment data set, and the inputs and outputs from the ecosystem models.
Code for cleaning the input data, and R libraries used for the analysis, are contained in the ‘Rmd’ files such as this one. Only Key steps in the analysis are shown in the documents generated, code used for plotting are not echoed in the output but can be found in the ‘Rmd’ file.
This vignette is divided into sections for Installation of the required libraries, sourcing bespoke functions, and loading the data, before the Operating Condition is conducted. Hypotheses about Natural Mortality and Stock Rcruitment are then fitted.
Details on Funding, Software Versions andReferences can be found at the end of the document.
library(FLCore)
library(ggplotFL)
library(ggpubr)
library(FLBRP)
library(FLasher)
library(FLAssess)
library(plyr)
library(dplyr)
library(reshape)
library(FLife)
library(FLBRP)
library(FLCandy)
library(FLSRTMB)
library(patchwork)
library(stockassessment)
library(FLfse)
library(FishLife)
theme_set(theme_bw(16))
Figure 1 Harvest Control Rule
The data are the ICES inputs and historical estimates [@ICES2023] generated by “10_ICES” which runs the ICES assessment
par=as(model.frame(mcf(FLQuants(ftar=refs[["fmsy"]],
btrig=refs[["msybtrigger"]],
fmin=refs[["fmsy"]]%=%0.005,
bmin=refs[["blim"]]%=%0,
blim=refs[["blim"]])),drop=T)[,-1],"FLPar")
par["ftar"][ is.na(par["ftar"])] =min(par["ftar"], na.rm=T)
par["btrig"][is.na(par["btrig"])]=min(par["btrig"],na.rm=T)
par["blim"][ is.na(par["blim"])] =min(par["blim"], na.rm=T)
ref2021=FLPar(laply(refs,window, end=2021, start=2021))
dimnames(ref2021)$params=c("Flim","Fpa","Fmsy","Fcap","Blim","Bpa","MSYBtrigger")
plot(oms[c(2,1,3,5)])
bias=ldply(oms[c("M=0.15","North Sea","Barents Sea")], function(x)
model.frame(FLQuants(F =fbar(oms[["Reference"]])%/%fbar(x),
SSB=ssb( oms[["Reference"]])%/%ssb( x)),drop=TRUE))
ggplot(bias)+
geom_point(aes(F,SSB,col=.id))
biasMatrix=ddply(bias,.(.id), with, data.frame(F=mean(F),SSB=median(SSB)))
biasMatrix[2,1]="Reference"
SRR
Natural Mortality
R version 4.4.2 (2024-10-31 ucrt)
FLCore: 2.6.20.9337
ggplotFL: 2.7.0.9139
FLBRP: 2.5.9.9051
FLasher: 0.7.1.9223
FLAssess: 2.6.3.9001
FLife: 3.4.0
mydas: 1.2.2
FLCandy: 1.6.1
FLSRTMB: 1.1.4.9013
plyr: 1.8.9
dplyr: 1.1.4
reshape: 0.8.9
FLfse: 1.0.2
stockassessment: 0.12.0
FishLife: 2.6.3.9001
patchwork: 1.3.0
Compiled: Wed Jul 2 18:38:32 2025
Git Hash: ‘9eb583b’