Quick link to: home, packages, courses

Introduction course FLR at JRC

Chairs: R.Scott (UK) and J.J.Poos (Netherlands)

Place: JRC

Dates: 31 March - 03 April 2008

Duration: 4 days.

Participants: 16

Software requirements: R_2.6.2 can be downloaded from http://cran.r-project.org/
A usefull text editor is tinn-R which can be downloaded from the sourceforge web-site http://sourceforge.net/projects/tinn-r/

Required Packages to install: We will show later how to install these packages

* FLCore
* FLEDA
* FLAssess
* FLXSA
* FLSTF
* FLBRP
* FLRDynState

Data Sets: A number of data sets (e.g. ple4) are already included in the FLCore package and could be used for the demonstration (type data(ple4) in R GUI). However we suggest that participants come with their own assessment data set (Lowestoft format) and work directly to apply the methods to these.
Alternatively, sets from the North Sea Plaice and from the Southern Hake are avalaible on this wiki.

Course Objectives

FLR has been developed to enable the development of MSE models and techniques through a collaborative and open source approach. The objectives of this course are to provide an overview of the classes and data structures that comprise FLR and to show how its modular approach to model building enables very complex models to be developed from the combination of simple, smaller units. The course will show how FLR can be used for simple data exploration and stock assessment as well as for complex MSE simulations. Participants are encouraged to bring their own data and to apply the software to their specific requirements.

Program

1. Monday

(10:00 - 17:00)

Objective By the end of the first day you should have an understanding of the package FLCore, its classes and methods and the philosophy behind its construction.

General Introduction

  • Course Outline and Workshop Objectives
  • Course Structure
  • Introduction to the course material

Brief introduction to R

R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. Extensive documentation, manuals and FAQs are available on the Internet, but a good way to start is to visit the R wiki, where a broad variety of documentation about R is compiled.

See also the Installation tutorial and introduction to R

Introduction to FLR (Fisheries Library in R)

  • philosophy

The FLR framework is a joint development effort directed towards the evaluation of management strategies. The overall goal is to develop a common framework to facilitate collaboration within and across disciplines, and in particular to ensure that models and software once developed are more easily validated, evaluated and more widely available for a variety of tasks. In particular it details how to implement a variety of fishery, biological and economic software in a common framework so that alternative management strategies and procedures can be evaluated for their robustness to uncertainty before implementation.

  • S4 classes

Link to the presentation Introduction_to_FLR.pdf and to the Galway paper (ICES SFMS 06: Kell et al (2007) FLR: an open-source framework for the evaluation and development of management strategies, IJMS 2007) for a general introduction to FLR

The FLQuant

  • FLQuants

The FLR framework is implemented using object-oriented programming (OOP). The essence of OOP is to treat data, and the procedures that act upon data, as a single “object”. These objects are of particular types representing the different elements of a system. Using this approach, different elements of fisheries systems are represented as core classes and the framework is extendable by adding new classes.

The basic building block for the construction of the core classes in FLR is the FLQuant. The FLQuant is an array of 5 dimensions (or 6 dimensions in version 2 and above). The first tutorial will introduce you to the FLQuant object.

link to FLQuant tutorial

Exercises : creating FLQuant; Subsetting; Using methods : window, summary, plot

FLCore Classes

Composite objects can be constructed from collections of FLQuants and other objects. Composite objects have been created to represent the different elements of fisheries systems.

  • composite objects

FLStock represents a stock object and contains the information required for conducting an assessment
FLBiol represents the underlying biological population that comprises part of the Operating Model
FLFleet represents a fleet object which may be the entire fishery or just a single vessel
FLCatch a component of FLFleet representing the catches of a specific stock, species or population
FLIndex represents a index of population abundance for use in stock assessment

FLCore Methods

Everything in R can be thought of in terms of tasks and objects. Tasks are the computations and objects are the things that computations manipulate. Tasks are organised by functions and objects are organised by classes. Every object belongs to a class that describes what the object is, what information it contains and how it relates to other classes. Functions and classes come together in methods, which are generic functions. Methods decide how function calls should be evaluated depending on the classes of objects appearing as arguments to them. The next tutorial introduces the FLCore classes and illustrates some of the functions and methods available to them.

link to Composite object tutorial

Exercises : create FLStock and FLIndex for other stocks from VPA files brought by participants

2. Tuesday

Objective By the end of the second day you should be able to import data into FLR, manipulate data structures within FLR and perform all of the necessary processes in conducting a stock assessment.

FLEDA

The package FLEDA comprises classes and methods for interrogating data contained within the FLR classes. It has been developed specifically to conduct exploratory data analyses and to visualise the data prior to performing a stock assessment. The following tutorial illustrates the use of FLEDA and uses as example the stock of southern hake. The southern hake data can be downloaded from the tutorial page.

link to FLEDA tutorial

Exercise : use FLEDA to make plots of yield trends, yield vs. effort, catch at age, CPUE, internal consistency, catch weight, biomass trends, catch curves, total mortality

Conducting Assessments in FLR

One of the reasonably well developed areas of FLR is the stock assessment part. Several methods are available and have been used in ICES assessment working groups. To show the details, we will demonstrate conducting an assessment with FLR

Exercise : Conduct an XSA, output summary plots.

Fitting Stock Recruit Relationships

link to SRR tutorial

Exercise : The segmented regression stock recruit fit to the Greenland Halibut data set gives very different fits for slight changes in estimates of SSB. The files below provide the SRR input data and the R code for an analysis of the fitting problem.

Greenland Halibut SRR data

FLSR is extended from FLModel. The following link shows how FLModel can be extended to generate a class for growth model fitting.

FLGrowth example

3. Wednesday

Objective Further aspects of fisheries modelling

MSE Simulation

First we show a number of simple Management Strategy evaluation examples. The FLR framework is a development effort directed towards the evaluation of fisheries management strategies. In particular, the framework enables you to implement and link a variety of fishery, biological and economic software so that alternative management strategies and procedures can be evaluated for their robustness to uncertainty before implementation.

Simulation can be used to examine two related questions:

i) does the stock assessment procedure provide estimates with reasonable accuracy and precision given the fishery system.

but specifically

ii) is a management strategy capable of achieving the management goals.

FLR can be used for both of these purposes.

The MSE approach requires mathematical representations of two systems: a ‘true’ system and an ‘observed’ one. The ‘true’ system is represented by the operating model (OM) that simulates the real world. In contrast, the ‘observed’ system represents the conventional management procedure (MP), from the data collection through stock assessment to the management implementation.

The example presented is an initial and relatively simple one. It uses the results of the working group stock assessment as the basis for the Operating Model and makes assumptions about the selection pattern of the fishing fleet and its dynamics.

The model comprises a single stock that is fished by a single fleet. It implements a relatively simple harvest control rule through a management procedure that explicitly models the stock assessment process and time lag in implementing the management advice.

The example presented here is useful as an illustration of the type of models that can be constructed.

Once the Management Strategy evaluation is done, there is a tutorial on how to use the Biological Reference Points package

The FLXSA stock assessment method has been available in FLR for a while. However, several other stock assessment methods are currently under development. During this day we explore SURBA (Survey Based Assessment) and ICA (Integrated Cath at Age). Also, it is possible to use the general-purpose optimization function in R, based on Nelder–Mead, quasi-Newton and conjugate-gradient algorithms, to create stock assessment methods by yourself.

  • Creating your own stock assessment methods in R/FLR
  • Using Surba
  • Using FLICA

The tutorial on these stock assessment methods can be found at

4. Thursday

Today we do not have a fixed schedule, but there is an example of a bio-economic model for fishing fleets

Fleet behaviour model

Developing Packages in R

FLR is an open source software development initiative. Whilst the core package, FLCore, is developed and maintained by the FLCore development team, contributory packages may be developed by anyone. Here is a quick introduction to the package development procedure. There is a more extensive manual available on CRAN, written by the R-developers, available here.

 
courses/jrc08.txt · Last modified: 2009/02/06 20:55
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki