190 likes | 279 Views
Explore effects of management strategies and ecological factors on fish populations using varying model degrees of realism. Practical guidance on using FLR to build models in R and comparing outcomes for fisheries research.
E N D
Two Approaches to Modelling Bruce McAdam The University of Aberdeen With Daniel Howell, Christian von Dorrien and Tara Marshall
UNCOVER Models • We want to explore • The effects of different management strategies on fish populations • The effects of different aspects of biology/ecology/environment on fish populations • To answer these questions we need • Models with different degrees of realism • Models implementing different management strategies • We compare the outcomes of different models
For Example • How will climate change affect chances of stock recovery? • Model with two different climate scenarios • Requires a model that depends realistically on climate • Does improved understanding of SR relationship affect expectations of recovery? • Model a simple SR relationship • And a more complex one • Compare projections.
Practical Matters • We need to go from our understanding of the fisheries • And create working models, in the form of computer programs. • Generally we will use FLR to do this, but there are many design decisions to make
Two Approaches • Start with a simple model of biology • Make it more complex • This could be done in R • This lets us compare different models of ecology • FLR also makes adding different management strategies easy • Start with a (preexisting) complex model • Integrate it into FLR in order to add different management strategies etc.
Examples • You want to know whether using a more detailed SR relation matters • start with a simple model in R (simple SR relation, e.g. current ICES assumptions) • Make it more complex (a different SR relation, e.g. incorporating temperature) • Compare results • You want to compare two HCRs using the best possible biological information • And you already have a detailed model of the stock • Call the existing model from FLR • Write R code for the different harvest rules and compare results.
Which to Use? • It depends on • What question you are asking • What prior work has been performed • What have you already got? • What skills are available
An Example • There are Gadget models of the Barents Sea ecosystem • These run from a stand-alone application • They are too complex to reimplement in R • We would like to experiment with different environmental scenarios and management strategies • So we need to use the Gadget model from within R
Gadget • It’s a model that can run simulations • Given files describing the stocks, and giving parameters for the model • It can also be used for model fitting • Given description of model, and observations of the system, work out the parameters • We are using it to run simulations only • Previous work (other projects) have done the model fitting • It runs as a stand-along application (.exe file) that reads and writes text files.
We use it like this… Gadget FLR
Implementation • Implement in R • But, whenever we need a biological simulation • Create Gadget input files • Run the Gadget command • Read data from Gadget output files • This contains actual stock and catch data • Gadget is treated as a black box • R knows nothing about the sort of model it is.
Algorithm (written in R) • Start with a folder containing all of Gadget’s input files • Run Gadget to generate output files • Main Loop (repeat for some number of years) • Read output files • Create necessary FLR objects • Run an assessment (e.g. XSA), apply a harvest control rule (HCR) • Update Gadget input files with next years catch/environment (and anything else needed) • Run Gadget with new input, and repeat the loop • After finishing, plot graphs etc.
Preliminary Results • The cod model is complex, so we are starting with a simpler (Icelandic) haddock model • We model a constant recruitment scenario, with different levels of TAC (fixed percentage of SSB). • This is all just experimentation to check it will be possible to implement useful models
Pretty Pictures TAC=10% of SSB TAC=50% of SSB
Technical Issues • We’ve done about 2 person-weeks of work • We had to implement • Reading data from Gadget • Writing data to Gadget • Running Gadget • Converting Gadget data into an FLR form (FLStock objects) • Running an assessment on the FLStocks • Surprisingly, we found it much easier to communicate with Gadget, than to do the assessment in FLR (work in progress)
Where Next? • Still to get assessments working for the haddock model • FLXSA • Then get it working with cod • Shouldn’t be too much work • And look (a bit) at efficiency
Summary • There are two different approaches to modelling • Write a model in R, and build it up • Start with a complex model, and call it from R • FLR can call external models • It’s not too difficult • You need to do quite a lot of programming in R – but not as much as implementing the model • The code you write will be case specific • The model doesn’t have to be Gadget.
Remember • My job is to help people customise models like this • But you need to keep me informed about your objectives etc. • And make sure you use me as a resource • Otherwise, the project will not make efficient use of my time (I work 100% on UNCOVER).