-
Notifications
You must be signed in to change notification settings - Fork 1
2.2 mpb
mpb is an R package for running and simulation testing biomass based stock assessment models. The package is part of FLR (Kell et al., 2007), a suite of open source R packages that are extensible and able to interact with many other R packages.
The package has methods for plotting, examining goodness of fit, deriving quantities used to provide management advice, estimating uncertainly, running projections, evaluating Harvest Control Rules (HCRs), and for conducting Management Strategy Evaluation (MSE).
Current Entry 12th September 2016
First Entry 25th April, 2017 (vers. 3.82)
First ICCAT Reference
Working paper SCRS/91/24 (ICCAT Coll. Vol. Sci. Pap. 37:218–229)
Catalogue Committee
Proposer: Haritz Arrizabalaga
Seconder: Hilario Murua
Reviewers: Jose De Oliveira, George Tserpes
ICCAT Secretariat
The package can be install from http://www.flr-project.org/ However, R will need to be installed first, see
https://cran.r-project.org/
There ia an installation script to install FLR packages i.e.
source("http://flr-project.org/R/instFLR.R")
If you know you have all the necessary dependencies, the package can be installed directly from the flr-project.org repository i.e.
install.packages("mpb",repos="http://flr-project.org/R")
There are a variety of resources that users can use for help i.e. vignettes, context sensitive help, examples and SCRS papers written using Rmarkdown.
The package includes a user guide in the form of a vignette which provides an introduction and examples of usage. Help on specific questions can be found by posting questions to the FLR mailing list.
All classes, methods are documented and context sensitive help. To get help on specific issues please post your questions or suggestions to the FLR mailing list. Conversations can be started at our scrollbak.io room. While bug reports for individual packages can be submitted using their individual github issues page.
Once R is installed, there is a comprehensive built-in help system. At the program's command prompt you can use any of the following:
help.start() general help
help(biodyn) help about class biodyn
?biodyn same thing
apropos("biodyn") list all functions containing string biodyn
example(biodyn) show an example of function biodyn
get vignettes on using installed packages vignette() show available vingettes vignette("mpb") show specific vignette
Examples and tutorials are included as part of the package in the form of vignettes that describe the types of problems that mpb is designed to solve and provide examples of how to solve them.
Observation Error Model Management Procedure
Two vignettes currently available; i.e. mpb.html that shows how to conduct a stock assessment using mpb and mse.html that shows how to evaluate management procedures based on biomass dynamic models as feedback control rules.
Example datasets are also provided; these are for the North Atlantic albacore and bigeye assessments conducted by ICCAT using ASPIC and the North Atlantic albacore Operating Model.
The source code is available from a github repository (https://github.com/laurieKell/mpb), a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. Bug reports can be submitted using the github issues page.
All source code is available from github, users are invited to download it and help improve the code.
Tests are included to ensure the validity of methods, and that results are reproducible. These are implemented using testthat. This ensure that tests are run automatically as code is changed. Two types of tests are conducted i.e.
- Tests of generic methods as part of the FLR test unit; and
- Validation of the stock assessment results, see below
The vignette provides the basis of test unit, i.e. if any changes are made to the code the vignette is recompiled and outputs compared to the vignette comiled under the previous version.
Laurence T. Kell
Sea Plus Plus
laurie@kell.es
http://www.seaplusplus.co.uk/
mpb uses object orientated programming (OOP) to implement the class biodyn that is used to model the stock assessment. OOPs is a programming paradigm that uses objects and their interactions to design applications and computer code. In OOPs a class is a description of a thing (i.e., how objects of a certain type look like), while an object is an instance of a class.
OOP is based on two concepts abstraction and encapsulation.
Abstraction is a process where only “relevant” data are shown and all unnecessary details are hidden from the user. Consider your mobile phone, you just need to know what buttons are to be pressed to send a message or make a call, What happens when you press a button, how your messages are sent, how your calls are connected is all abstracted away from the user.
Encapsulation is the process of combining data and functions into a single unit called a class. In Encapsulation, the data is not accessed directly; it is accessed through the functions present inside the class. In other words, attributes of the class are kept private and public getter and setter methods are provided to manipulate these attributes. Thus, encapsulation makes the concept of data hiding possible.
A class comprises a collection of data and methods, where te methods (i.e. functions) encapsulate a “generic" R concept, such as plot, logLik, residuals, etc. So that calling plot on an object produces something useful without having to worry about the details.
To run a biomass dynamic model requires a time series of total catch and an index of relative abundance. These can be provided in the form of an ASPIC input or results file, or as a variety of R objects.
Fitting a model to the data produces an object with parameter estimates, historical estimates of stock biomass, harvest rate, residuals and other diagnostics and estimates of uncertainty. These can be plotted, summarised, analysed further, or used as part of a management procedure.
A suite of diagnostics are available including, i) checks for convergence; ii) identify violation of assumptions by plotting residuals; iii) methods such as the jack knife or bootstrap to identify problems with the data and model specifications; and iv) conduct hindcasts to evaluate predictive ability and hence robustness of advice. The diagnostics are generic and applicable to models that use different datasets and a variety of structures (Kell and Merino, 2016). The methods for goodness of fit diagnostics are contained in the diags package.
The mpb package implements the production function Pella and Tomlinson (1969). It can replicate the logistic production function of ASPIC, see the ASPIC catalogue entry for details of biomass stock assessment methods
Validation (see above) is of two types i.e. validation of function code and evaluation of the reliability of the fits. The later was done using a variety of approaches e.g.
- Comparison to ASPIC (Kell, et al., 2016b)
- Self testing (see vignette)
- Cross testing (Kell, et al., 2016d)
- MSE (Kell, et al., 2013b)
The mpb package has been used by by IOTC
L. Kell and D. D. Examples of stock assessment diagnostic. ICCAT Collect. Vol. of Sci. Pap., (70), 2013.
L. Kell and P. De Bruyn. A preliminary stock assessment for north atlantic albacore using a biomass dynamic model. ICCAT Collect. Vol. of Sci. Pap., 73 (28), 2016a.
L. Kell and P. De Bruyn. Validation of biodyn, an r package to implement management procedures based on biomass dynamic models. ICCAT Collect. Vol. of Sci. Pap., 73 (27), 2016b.
L. Kell and P. De Bruyn. The implicit north atlantic albacore management procedure. ICCAT Collect. Vol. of Sci. Pap., 73 (25), 2016c.
L. Kell and P. De Bruyn. Cross testing of biodyn an r package to implement management procedures based on biomass dynamic models. ICCAT Collect. Vol. of Sci. Pap., 73 (26), 2016d.
L. Kell and P. De Bruyn. An observation error model for north atlantic albacore. ICCAT Collect. Vol. of Sci. Pap., 73 (24), 2016e.
L. Kell and P. De Bruyn. Conditioning an operating model for north atlantic albacore. ICCAT Collect. Vol. of Sci. Pap., 73 (23), 2016f.
L. Kell and et al. An example of a management procedure based on a biomass dynamic stock assessment model. ICCAT Collect. Vol. of Sci. Pap., (70): 2082–2087, 2013a.
L. Kell and et al. An example management strategy evaluation of a harvest control rule. ICCAT Collect. Vol. of Sci. Pap., (70): 2096–2110, 2013b.
L. Kell, D. Bruyn, P.,Maunder,M., Piner, K., Taylor, and I. Likelihood component profiling as a data exploratory tool for north atlantic albacore. ICCAT Collect. Vol. of Sci. Pap., (70): 1288–1293, 2013a.
L. Kell, M. P. K. De Bruyn, Maunder, and T. I.G. Likelihood component profiling as a data exploratory tool. ICCAT Collect. Vol. of Sci. Pap., 65: 119:x–xx, 2013b.
L. Kell, de Bruyn P. Merino G., and O. de Urbina J. Implementation of a harvest control rule for northern atlantic albacore. ICCAT Collect. Vol. of Sci. Pap., (70): 1355–1364, 2013c.
L. Kell, O. de Urbina, and P. J., De Bruyn. Likelihood profiles by data components to evaluate information content of indices of abundance. ICCAT Collect. Vol. of Sci. Pap., 65: 162:x–xx, 2013d.
L. Kell, O. de Urbina J., D. Bruyn, P., Mosqueira, I., Magnusson, and A. An evaluation of different approaches for modelling uncertainty in aspic and biomass dynamic models. ICCAT Collect. Vol. of Sci. Pap., (70): 2111–2119, 2013e.
L. Kell, O. de Urbina J.M., and de Bruyn P. Stock assessment diagnostics for north atlantic swordfish. ICCAT Collect. Vol. of Sci. Pap., (70): 1954–1963, 2013f.
L. Kell, O. de Urbina J.M., and de Bruyn P. Stock assessment diagnostics for south atlantic swordfish. ICCAT Collect. Vol. of Sci. Pap., (70): 1964–1969, 2013g.
L. Kell, J. Ortiz de Urbina, and P. De Bruyn. Likelihood profiles by data components to evaluate information content of indices of abundance for north atlantic swordfish. ICCAT Collect. Vol. of Sci. Pap., (70): 2120–2128, 2013h.
L. Kell, J. Ortiz de Urbina, and P. De Bruyn. Kobe II strategy matrices for north atlantic swordfish based on catch, fishing mortality and harvest control rules. ICCAT Collect. Vol. of Sci. Pap., (70): 2009–2016, 2013i.
L. Kell, H. R., F. J.M., and B. S. An example management strategy evaluation of a model free harvest control rule. ICCAT Collect. Vol. of Sci. Pap., (71), 2014.
L. Kell and Merino G. Diagnostics for a biomass dynamic stock assessment of Atlantic bigeye tuna (Thunnus obesus). ICCAT Collect. Vol. of Sci. Pap., (72): 245-265, 2015.
T. Matsumoto, L. Kell, A. H., Kiyofuji, and H. Preliminary analysis for the south atlantic albacore stock using a non-equilibrium production model. ICCAT Collect. Vol. of Sci. Pap., (70): 1276–1287, 2013.
G. Merino, de Bruyn P., P. G. Scott, and L. Kell. A preliminary assessment of the albacore tuna (thunnus alalunga) stock in the southern atlantic ocean using a non-equilibrium production model. ICCAT Collect. Vol. of Sci. Pap., (70): 1086–1093, 2013a.
G. Merino, de Bruyn P. Scott P. G., and L. Kell. A preliminary stock assessment of the albacore tuna (thunnus alalunga) stock in the northern atlantic ocean using a non-equilibrium production model. ICCAT Collect. Vol. of Sci. Pap., (70): 1074–1085, 2013b.