Title: | Generic Classes and Methods for Stock Assessment Models |
---|---|
Description: | A generic set of classes for stock assessment models are provided here. Individual assessment packages should extend the basic classes. |
Authors: | Iago Mosqueira [cre], Laurence T. Kell [aut] |
Maintainer: | Iago Mosqueira <[email protected]> |
License: | GPL-2 |
Version: | 2.6.3 |
Built: | 2024-11-14 03:43:10 UTC |
Source: | https://github.com/flr/FLAssess |
The assess
methods calls the stock assessment function according to the class
of the control object given. Stock assessment methods in FLR generally require a control
class that contains all the options the model and its fitting algorithm provide. Classes
are specific to each method, so see the relevant help pages for detailed information.
The assess method allows different stock assessment procedures to be carried out in a simulation procedure, or in any other function, by simply altering the control class in the argument list.
This is a generic method to be extended for individual stock assessment models.
The generic, to be extended for each specific assessment model
Results of performing an XSA on ple4 data
Datasets can be loaded by issuing data(ass)
.
FLAssess is the basic structure for age-based stock assessment. It provides a standard class for data input, diagnostic inspection and stock status estimation; either for use within a working group setting or as part of a formal Management Strategy Evaluation (MSE).
The FLAssess class can be extended to create specific implementations of assessment methods e.g. FLICA, FLSURBA, FLXSA, providing a common interface for all assessmnet methods. For example, within ICES there are two main stock assessment methods, ICA for pelagic and XSA for demersal stocks. However, differences between the methods are mainly artefacts of how they were independently developed rather than methodological. By incorporating such methods in a common class this problem will hopefully be avoided in the future.
FLAssess also incorporates methods for performing virtual population analysis (VPA) and stock projection.
In common with other FLR classes, all of the slots of the FLAssess class have accessor and replacement methods. Users are encouraged to use these instead of the @ slot accessor.
Objects can be created by calls to the methods VPA or SepVPA.
They also can be created by calls of the form
new("FLAssess", ...)
.
A character string give name of stock.
Whatever you want.
A named vector specifying the range of the object.
Call that generated the object.
An FLQuant that contains estimated catch numbers-at-age.
An FLQuant that contains estimated stock numbers-at-age.
An FLQuant that contains estimated fishing mortlaity-at-age.
A vector containing names for the FLIndexs
A list containing ranges for the FLIndexs
A list of FLQuants, corresponding to the index values used when fitting.
A list of FLQuants, corresponding to the fitted index values.
A list of FLQuants, corresponding to the index residuals.
A list of FLQuants, corresponding to the variances of index values in fitting.
Returns a list, with a vector for each dimension in the object, that contains the levels of each dimension.
Prints the given object.
Plots stock.n against index
Updates a FLStock with stock.n and harvest estimates from an FLAssess object
Updates a FLStock with stock.n and harvest estimates from an FLAssess object
Updates a FLStock with stock.n, catch.n & harvest estimates
Separable VPA
Virtual Population Analysis
FLR Team
FLIndices-class
,
FLStock-class
# see the Methods help pages for specific examples
# see the Methods help pages for specific examples
Objects of this class contain all the neccessary settings for the Separable VPA
model available through function SepVPA
.
Objects can be created by calls of the form new("FLSepVPA.control", ...)
or
by calling the FLSepVPA.control
function.
sep.nyr
:Object of class "integer"
. Number of years for separable model.
sep.age
:Object of class "integer"
. Reference age for fitting the separable model. Default value = 4
sep.sel
:Object of class "numeric"
. Default value = 1.0
No methods defined with class "FLSepVPA.control" in the signature.
Iago Mosqueira
JG Shepherd, SM Stevens. 1983. Separable VPA: User's guide - Int. Rep., MAFF Direct. Fish. Res.
FLSepVPA
sep.vpa.control <- FLSepVPA.control(sep.nyr=5, sep.age=5)
sep.vpa.control <- FLSepVPA.control(sep.nyr=5, sep.age=5)
This method sets the slots discards.n
and discards.wt
to 0, and
sets the slots catch
, catch.n
and catch.wt
to their landings
equivalents.
no.discards<-(obj)
Takes in an object of type FLStock
and carries out
the above actions. Returns an object of type FLStock
Standard plot methods for the FLAssess
class. FLR plot methods are based on
lattice
, and attempt to show a general view of the object
contents.
Users are encouraged to write their own plotting code make use of the overloaded
lattice
methods, for example xyplot
or
bwplot
. See also lattice-FLCore
.
Plot of an FLAssess object.
The FLR Team
Performs Separable Virtual Population Analysis. Methods for function
SepVPA
in package in Package ‘FLAssess’. Requires an object of class
FLSepVPA.control
to be created.
SepVPA<-function(stock, control=FLSepVPA.control(), ref.harvest="missing", fratio="missing", fit.plusgroup=TRUE, desc="",...)
, where
stock
is of type FLStock
, control
is of type FLSepVPA.control()
, ref.harvest
and fratio
are numeric and fit.plusgroup
is Boolean.
# Example based on ple4 dataset data(ple4) # Set up stock with correct dimensions my.stock <- FLStock(catch.n(ple4)) my.stock@range["plusgroup"] <- 15 #load catch data and mortality [email protected] <- [email protected] [email protected][[email protected]==0] <- 1 my.stock@m <- ple4@m my.control <- FLSepVPA.control(sep.age = 5) # Set up in final year [email protected][,"2001"] <- [email protected][,"2001"] # Run SepVPA my.stock.SepVPA <- SepVPA(my.stock, my.control, fit.plusgroup=TRUE)
# Example based on ple4 dataset data(ple4) # Set up stock with correct dimensions my.stock <- FLStock(catch.n(ple4)) my.stock@range["plusgroup"] <- 15 #load catch data and mortality my.stock@catch.n <- ple4@catch.n my.stock@catch.n[my.stock@catch.n==0] <- 1 my.stock@m <- ple4@m my.control <- FLSepVPA.control(sep.age = 5) # Set up in final year my.stock@stock.n[,"2001"] <- ple4@stock.n[,"2001"] # Run SepVPA my.stock.SepVPA <- SepVPA(my.stock, my.control, fit.plusgroup=TRUE)
Implements Pope's Virtual Population Analysis (VPA).
The method returns an object of class FLVPA
class. This extends the FLAssess
class although
the FLVPA
class currently has the same slots as the FLAssess
class and does not add new ones.
Objects can be created by calls of the form new("FLVPA", ...)
or by calling the VPA
function.
The other arguments to VPA
are
A numeric
with default "missing"
A Boolean
with default TRUE
A character
string which appended to the desc slot of the object
For the sake of speed, most of the calculations are carried out in C.
VPA(stock, ...)
Performs a VPA on the FLStock object. Other arguments are fratio, fit.plusgroup and desc, which are described above.
Laurence Kell
FLSepVPA
# use the ple4 data set data(ple4) ple4.test <- ple4 # Remove 0s and set as 1s catch.n(ple4.test)[catch.n(ple4.test)==0] <- 1 # Remove harvest and stock.n values stock.n(ple4.test)[] <- NA harvest(ple4.test)[] <- NA # Set Fs in final year and final ages harvest(ple4.test)[,"2001"] <- harvest(ple4)[,"2001"] harvest(ple4.test)["10",] <- harvest(ple4)["10",] # Run the VPA ple4.vpa <- VPA(ple4.test) # Take a look at the harvest plot(harvest(ple4.vpa))
# use the ple4 data set data(ple4) ple4.test <- ple4 # Remove 0s and set as 1s catch.n(ple4.test)[catch.n(ple4.test)==0] <- 1 # Remove harvest and stock.n values stock.n(ple4.test)[] <- NA harvest(ple4.test)[] <- NA # Set Fs in final year and final ages harvest(ple4.test)[,"2001"] <- harvest(ple4)[,"2001"] harvest(ple4.test)["10",] <- harvest(ple4)["10",] # Run the VPA ple4.vpa <- VPA(ple4.test) # Take a look at the harvest plot(harvest(ple4.vpa))
This method calculates total mortatility from the simple addition of m
and harvest
.
Z(obj)
Takes in an object of type FLStock
and carries out
the above actions. Returns an object of type FLQuant
data(ple4) Z(ple4)
data(ple4) Z(ple4)