Title: | Bio-Economic Impact Assessment of Management Strategies using FLR |
---|---|
Description: | A simulation toolbox that describes a fishery system under a Management Strategy Estrategy approach. The objective of the model is to facilitate the Bio-Economic evaluation of Management strategies. It is multistock, multifleet and seasonal. The simulation is divided in 2 main blocks, the Operating Model (OM) and the Management Procedure (MP). In turn, each of these two blocks is divided in 3 components: the biological, the fleets and the covariables on the one hand, and the observation, the assessment and the advice on the other. |
Authors: | FLBEIA Team [aut, cre] |
Maintainer: | FLBEIA Team <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.16.1.19 |
Built: | 2024-11-14 03:15:06 UTC |
Source: | https://github.com/flr/FLBEIA |
There are several HCRs available in FLBEIA which are used within the main function FLBEIA to generate the management advice in each step. But they can also be used independently.
annualTAC(stocks, advice, advice.ctrl, year, stknm, ...) F2CatchHCR(stocks, advice, advice.ctrl, year, stknm, ...) FroeseHCR(stocks, advice, advice.ctrl, year, stknm, ...) IcesHCR(stocks, advice, advice.ctrl, year, stknm, ...) neaMAC_ltmp(stocks, advice, advice.ctrl, year, stknm, ...) aneHCRE(stocks, advice, advice.ctrl, year, stknm, ...) annexIVHCR(indices, advice, advice.ctrl, year, stknm, ...) ghlHCR(indices, advice, advice.ctrl, year, stknm, ...) IcesCat3HCR(indices, advice, advice.ctrl, year, stknm, ...) IcesCat3HCR_bsafe_hrcap(indices, advice, advice.ctrl, year, stknm, ...) MAPHCR(stocks, advice, advice.ctrl, year, stknm, ...) CFPMSYHCR(stocks, advice, advice.ctrl, year, stknm, ...) MultiStockHCR(stocks, indices, advice, advice.ctrl, year, stknm, ...) pidHCR(indices, advice, advice.ctrl, year, stknm, ...) pidHCRItarg(indices, advice, advice.ctrl, year, stknm, ...) little2011HCR(indices, advice, advice.ctrl, year, stknm, ...)
annualTAC(stocks, advice, advice.ctrl, year, stknm, ...) F2CatchHCR(stocks, advice, advice.ctrl, year, stknm, ...) FroeseHCR(stocks, advice, advice.ctrl, year, stknm, ...) IcesHCR(stocks, advice, advice.ctrl, year, stknm, ...) neaMAC_ltmp(stocks, advice, advice.ctrl, year, stknm, ...) aneHCRE(stocks, advice, advice.ctrl, year, stknm, ...) annexIVHCR(indices, advice, advice.ctrl, year, stknm, ...) ghlHCR(indices, advice, advice.ctrl, year, stknm, ...) IcesCat3HCR(indices, advice, advice.ctrl, year, stknm, ...) IcesCat3HCR_bsafe_hrcap(indices, advice, advice.ctrl, year, stknm, ...) MAPHCR(stocks, advice, advice.ctrl, year, stknm, ...) CFPMSYHCR(stocks, advice, advice.ctrl, year, stknm, ...) MultiStockHCR(stocks, indices, advice, advice.ctrl, year, stknm, ...) pidHCR(indices, advice, advice.ctrl, year, stknm, ...) pidHCRItarg(indices, advice, advice.ctrl, year, stknm, ...) little2011HCR(indices, advice, advice.ctrl, year, stknm, ...)
stocks |
And FLStocks object. |
advice |
A list with two FLQuant elements, TAC and quota.share. TAC is an FLQuant with quant dimension equal to the number of stocks in biols object, the names used in in the quant dimension must be equal to those used in biols. quota.share is a list with one element per stock in biols object indicating the quota share per stock and fleet. The quant dimension of the elements must be equal to the number of fleets and the names used must be equal to those in fleets objects. |
advice.ctrl |
A list with the settings to control the advice model for each stock (the HCR for each stock, the reference points used in the HCR, additional parameters, ...) |
year |
The position of the assessment year in the stocks and advice objects. |
stknm |
The name of the stock for which advice is being generated. |
... |
Any extra arguments needed for specific HCRs. |
indices |
A list of FLIndices. Each element must correspond with one of the stocks in biols object. |
There are two types of HCRs model-free HCRs and model-Based HCRs. Model-free HCRs use abundance indices to generate the advice and hence it use FLIndices object as input data. Model-based HCRs use estimates of stock abundance and stock exploitation level to generate the advice.
Model-Free HCRs: annexIVHCR, ghlHCR, little2011HCR, pidHCR, pidHCRItarg, IcesCat3HCR and IcesCat3HCR_bsafe_hrcap.
Model-Based HCRs: aneHCRE, annualTAC, CFPMSYHCR, F2CatchHCR, FroeseHCR, IcesHCR, MAPHCR, neaMAC_ltmp.
Rules' description:
aneHCRE: The HCR used in the bay of biscay anchovy long term management plan.
aneHCRs: The HCRs (escapement biomass) tested for the bay of biscay anchovy with different calendars. For details see Sanchez et al. 2019. MEPS 617-618: 245-263.
annexIVHCR: The HCR used by EC and ICES to generate the TAC advice for data poor stocks.
annualTAC: A HCR that generates annual TAC advice. The HCR provides the whole flexibility of fwd.
CFPMSYHCR: HCR adapting the MAP HCR to allow flexibility in the year Fmsy is achieved. The user can specify the year in which you aim to reach Fmsy, with a linear transition between Fsq to Fmsy in the intervening years
F2CatchHCR: This HCR transforms the fishing mortality advice given as input data to catch advice without any other restriction.
FroeseHCR: The HCR defined in the paper by Froese, Branch et al. in Fish and Fisheries 2011.
ghlHCR: The model-free HCR used in the management of greenland-halibut
IcesHCR: The HCR used by ICES to generate TAC advice in the MSY framework.
IcesCat3HCR: HCR that implements the ICES HCR for Category 3 DLS stocks (see ICES CM 2012/ACOM 68: Category 3 - Method 3.2)
IcesCat3HCR_bsafe_hrcap: Alternative approach for IcesCat3HCR with a biomass safeguard and harvest rate caps (from ICES WKDLSSLS2019)
little2011HCR: The HCR defined in the paper by Little et al. in ICES Journal of Marine Science 2011.
MAPHRC: The HCR proposed by the EC in the evaluation on multi-annual management plans in 2015.
MultiStockHRC: A HCR that produces TAC advice for several stocks simultaneously. It uses a fishing mortality target and an upper bound to conciliate the TAC advices. In the case of stocks without exploitation rate estimates it uses the catch.
neaMAC_ltmp: The HCR used in the north-east atlantic mackerel long term management plan. It is a particular case of the IcesHCR.
pidHCR, pidHCRItarg: The HCRs defined in the paper by Pomaerede et al. in Aquatic Living Resources 2010.
The HCRs are documented in detail in the manual of the library.
The advice input object updated with the management advice (TAC) generated by the HCR.
## Not run: library(FLBEIA) library(FLAssess) # required to use the IcesHCR. Not available for win64 library(FLash) # required to use the IcesHCR. Not available for win64 library(ggplot2) # Load the data to run FLBEIA in a one stock one fleet example using the HCR used by ICES # in the MSY framework. data(one) oneAdv$TAC[,ac(2009:2025)] <- NA # Put NA-s in the projection years to check how the # function fills the advice object. res <- IcesHCR(oneSt, oneAdv, oneAdvC, 19, 'stk1') # The value printed in the screen is the fishing mortality used in the advice. res$TAC[,'2009'] # The resulting management advice. ## End(Not run)
## Not run: library(FLBEIA) library(FLAssess) # required to use the IcesHCR. Not available for win64 library(FLash) # required to use the IcesHCR. Not available for win64 library(ggplot2) # Load the data to run FLBEIA in a one stock one fleet example using the HCR used by ICES # in the MSY framework. data(one) oneAdv$TAC[,ac(2009:2025)] <- NA # Put NA-s in the projection years to check how the # function fills the advice object. res <- IcesHCR(oneSt, oneAdv, oneAdvC, 19, 'stk1') # The value printed in the screen is the fishing mortality used in the advice. res$TAC[,'2009'] # The resulting management advice. ## End(Not run)
Function to generate an FLStock from an FLBiol and FLFleet
biolfleets2flstock(biol, fleets)
biolfleets2flstock(biol, fleets)
biol |
An FLBiolobject |
fleets |
An FLFleetExt object |
An FLStock object with abundance and biological information from biol argument and exploitation levels from fleets argument
## Not run: data(res_flbeia) biol <- oneRes$biols$stk1 fleets <- oneRes$fleets stk <- biolfleets2flstock( biol=biol, fleets=fleets) ## End(Not run)
## Not run: data(res_flbeia) biol <- oneRes$biols$stk1 fleets <- oneRes$fleets stk <- biolfleets2flstock( biol=biol, fleets=fleets) ## End(Not run)
Summarize the results of the simulation in data frames.
bioSum( obj, stknms = "all", years = dimnames(obj$biols[[1]]@n)$year, long = FALSE, scenario = "bc", byyear = TRUE, ssb_season = NULL, brp = NULL ) bioSumQ(obj, prob = c(0.95, 0.5, 0.05)) fltSum( obj, flnms = "all", years = dimnames(obj$biols[[1]]@n)$year, byyear = TRUE, long = FALSE, InterestRate = 0.03, scenario = "bc" ) fltSumQ(obj, prob = c(0.95, 0.5, 0.05)) fltStkSum( obj, flnms = names(obj$fleets), stknms = catchNames(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc", verbose = TRUE ) fltStkSumQ(obj, prob = c(0.95, 0.5, 0.05)) mtStkSum( obj, flnms = names(obj$fleets), stknms = catchNames(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc" ) mtStkSumQ(obj, prob = c(0.95, 0.5, 0.05)) mtSum( obj, flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc" ) mtSumQ(obj, prob = c(0.95, 0.5, 0.05)) advSum( obj, stknms = "all", years = dimnames(obj$biols[[1]]@n)$year, long = FALSE, scenario = "bc" ) advSumQ(obj, prob = c(0.95, 0.5, 0.05)) riskSum( obj, stknms = names(obj$biols), Bpa, Blim, Prflim, flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], scenario = "bc" ) npv( obj, discF = 0.05, y0, flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], scenario = "bc" ) npvQ(obj, prob = c(0.05, 0.5, 0.95)) vesselSum( obj, flnms = "all", years = dimnames(obj$biols[[1]]@n)$year, byyear = TRUE, long = FALSE, scenario = "bc" ) vesselSumQ(obj, prob = c(0.95, 0.5, 0.05)) vesselStkSum( obj, flnms = names(obj$fleets), stknms = catchNames(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc" ) vesselStkSumQ(obj, prob = c(0.95, 0.5, 0.05))
bioSum( obj, stknms = "all", years = dimnames(obj$biols[[1]]@n)$year, long = FALSE, scenario = "bc", byyear = TRUE, ssb_season = NULL, brp = NULL ) bioSumQ(obj, prob = c(0.95, 0.5, 0.05)) fltSum( obj, flnms = "all", years = dimnames(obj$biols[[1]]@n)$year, byyear = TRUE, long = FALSE, InterestRate = 0.03, scenario = "bc" ) fltSumQ(obj, prob = c(0.95, 0.5, 0.05)) fltStkSum( obj, flnms = names(obj$fleets), stknms = catchNames(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc", verbose = TRUE ) fltStkSumQ(obj, prob = c(0.95, 0.5, 0.05)) mtStkSum( obj, flnms = names(obj$fleets), stknms = catchNames(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc" ) mtStkSumQ(obj, prob = c(0.95, 0.5, 0.05)) mtSum( obj, flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc" ) mtSumQ(obj, prob = c(0.95, 0.5, 0.05)) advSum( obj, stknms = "all", years = dimnames(obj$biols[[1]]@n)$year, long = FALSE, scenario = "bc" ) advSumQ(obj, prob = c(0.95, 0.5, 0.05)) riskSum( obj, stknms = names(obj$biols), Bpa, Blim, Prflim, flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], scenario = "bc" ) npv( obj, discF = 0.05, y0, flnms = names(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], scenario = "bc" ) npvQ(obj, prob = c(0.05, 0.5, 0.95)) vesselSum( obj, flnms = "all", years = dimnames(obj$biols[[1]]@n)$year, byyear = TRUE, long = FALSE, scenario = "bc" ) vesselSumQ(obj, prob = c(0.95, 0.5, 0.05)) vesselStkSum( obj, flnms = names(obj$fleets), stknms = catchNames(obj$fleets), years = dimnames(obj$biols[[1]]@n)[[2]], byyear = TRUE, long = FALSE, scenario = "bc" ) vesselStkSumQ(obj, prob = c(0.95, 0.5, 0.05))
obj |
The output of the FLBEIA function. |
stknms |
Names of the stock for which the indicators will be calculated. |
years |
the names of the years for which the indicators will be calculated. |
long |
logical. The data frame should be constructed using long or wide format? Default FALSE. |
scenario |
a character string with the name of the scenario corresponding with obj. Default bc. |
byyear |
logical. The indicators should be provided at season or year level? Default TRUE. |
ssb_season |
If byyear = TRUE, the season in which ssb will be taken. |
brp |
a data frame with columns stock, iter and one colum per reference point with the value of the biological reference points per stock and iteration. The used reference points are Bpa, Blim, Btarget, Fpa, Flim and Ftarget. |
prob |
a numeric vector with the probabilities used to calculate the quantiles. |
flnms |
Names of the fleet for which the indicators will be calculated. |
InterestRate |
Capital oportunity cost rate. |
verbose |
logical. If TRUE, prints the function steps. |
Bpa |
named numeric vector with one element per stock in stknms. The precautionary approach stock spawning biomass used in riskSum function to calculate biological risk yearly. |
Blim |
named numeric vector with one element per stock in stknms. The limit stock spawning biomass used in riskSum function to calculate biological risk yearly. |
discF |
Discount rate. |
y0 |
character. Reference year. |
ProfRef |
named numeric vector with one element per fleet in flnms. The reference profit level used in riskSum function to calculate economic risk yearly. |
advSum, advSumQ: Data frame with the indicators related with the management advice (TAC). The indicators are: "catch", "discards", "discRat", "landings", "quotaUpt" and "tac".
bioSum, bioSumQ: Data frame with the biological indicators. The indicators are: "biomass", "catch", "catch.iyv", "discards", "disc.iyv", "f", "landings", "land.iyv", "rec" and "ssb".
fltSum, fltSumQ: Data frame with the indicators at fleet level. The indicators are: "capacity", "catch", "costs", "discards", "discRat", "effort", "fcosts", "gva", "grossValue", "landings", "fep", "nVessels", "price", "grossSurplus", "quotaUpt", "salaries", "vcosts" and "profitability".
fltStkSum, fltStkSumQ: Data frame with the indicators at fleet and stock level. The indicators are: "landings", "discards", "catch", "price", "quotaUpt", "tacshare", "discRat" and "quota".
npv: A data frame with the net present value per fleet over the selected range of years.
mtSum, mtSumQ: Data frame with the indicators at metier level. The indicators are: "effshare", "effort", "grossValue" and "vcost".
mtStkSum, mtStkSumQ: Data frame with the indicators at fleet and metier level. The indicators are: "catch", "discards", "discRat", "landings" and "price".
riskSum: A data frame with the risk indicators. The indicators are: "pBlim", "pBpa" and "pPrflim".
vesselSum, vesselSumQ: Data frame with the indicators at vessel level. The indicators are: "catch", "costs", "discards", "discRat", "effort", "fcosts", "gva", "grossValue", "landings", "fep", "price", "grossSurplus", "quotaUpt", "salaries", "vcosts" and "profitability".
vesselStkSum, vesselStkSumQ: Data frame with the indicators at vessel and stock level. The indicators are: "landings", "discards", "catch", "price", "quotaUpt", "tacshare", "discRat" and "quota".
summary_flbeia: An array with four dimensions: stock, year, iteration, indicator. The indicators are: recruitment, ssb, f, biomass, catch, landings and discards.
ecoSum_damara: ecoSum built in the framework of Damara project.
The data frames
A data frame with columns for scenario, year, stock, iter, indicator, value,...
The data frames can be of wide or long format. In long format all the indicators are in the same column. There is one column, indicator, for the name of the indicator and a second one value for the numeric value of the indicator. In the wide format each of the indicators correspond with one column in the data frame. The long format it is recommendable to work with ggplot2 functions for example while the wide format it is more efficient for memory allocation and speed of computations.
The quantile version of the summaries, fooQ, returns the quantiles of the indicators. In the long format as many columns as elements in prob are created. The name of the columns are the elements in prob preceded by a q. In the wide format for each of the indicators as many columns as elements in prob are created. The names of the colums are the elements in prob preceded by q_name_of_the_indicator.
## Not run: library(FLBEIA) # Apply the summary functions to the examples runs in FLBEIA help page. # Test the different arguments in summary function. data(res_flbeia) #------------------------------------------------ # Example One: One stock, one fleet, one iter. #------------------------------------------------ # Wide format (default) oneRes_bio <- bioSum(oneRes) oneRes$fleets[[1]] <- setUnitsNA(oneRes$fleets[[1]]) oneRes_flt <- fltSum(oneRes) oneRes_fltStk <- fltStkSum(oneRes) oneRes_mt <- mtSum(oneRes) oneRes_mtStk <- mtStkSum(oneRes) oneRes_adv <- advSum(oneRes) head(oneRes_bio) head(oneRes_flt) head(oneRes_fltStk) head(oneRes_mt) head(oneRes_mtStk) head(oneRes_adv) oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) head(oneRes_bioQ) head(oneRes_fltQ) head(oneRes_fltStkQ) head(oneRes_mtQ) head(oneRes_mtStkQ) head(oneRes_advQ) # Long format for a range of years oneRes_bio <- bioSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_flt <- fltSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_fltStk <- fltStkSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_mt <- mtSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_mtStk <- mtStkSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_adv <- advSum(oneRes, long = TRUE, years = ac(2016:2020)) head(oneRes_bio) head(oneRes_flt) head(oneRes_fltStk) head(oneRes_mt) head(oneRes_mtStk) head(oneRes_adv) oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) head(oneRes_bio) head(oneRes_flt) head(oneRes_fltStk) head(oneRes_mt) head(oneRes_mtStk) head(oneRes_adv) # Wide format with seasonal disaggregation # (Note: No seasonal disagregation available for adv summaries) oneRes_bio <- bioSum(oneRes, byyear = FALSE) oneRes_flt <- fltSum(oneRes, byyear = FALSE) oneRes_fltStk <- fltStkSum(oneRes, byyear = FALSE) oneRes_mt <- mtSum(oneRes, byyear = FALSE) oneRes_mtStk <- mtStkSum(oneRes, byyear = FALSE) oneRes_adv <- advSum(oneRes) # Advice summary is only by year. oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) # Long format and seasonal oneRes_bio <- bioSum(oneRes, long = TRUE) oneRes_flt <- fltSum(oneRes, long = TRUE, byyear = FALSE) oneRes_fltStk <- fltStkSum(oneRes, long = TRUE, byyear = FALSE) oneRes_mt <- mtSum(oneRes, long = TRUE, byyear = FALSE) oneRes_mtStk <- mtStkSum(oneRes, long = TRUE, byyear = FALSE) oneRes_adv <- advSum(oneRes, long = TRUE) # Advice summary is only by year. oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) #------------------------------------------------ # Example OneIt: As one but with iterations. #------------------------------------------------ # Wide format (default) oneItRes_bio <- bioSum(oneItRes, scenario = 'with_iters') oneItRes$fleets[[1]] <- setUnitsNA(oneItRes$fleets[[1]]) oneItRes_flt <- fltSum(oneItRes, scenario = 'with_iters') oneItRes_fltStk <- fltStkSum(oneItRes, scenario = 'with_iters') oneItRes_mt <- mtSum(oneItRes, scenario = 'with_iters') oneItRes_mtStk <- mtStkSum(oneItRes, scenario = 'with_iters') oneItRes_adv <- advSum(oneItRes, scenario = 'with_iters') oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) # Long format for a range of years oneItRes_bio <- bioSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_flt <- fltSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_fltStk <- fltStkSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_mt <- mtSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_mtStk <- mtStkSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_adv <- advSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) # Wide format with seasonal disaggregation # (Note: No seasonal disagregation available for adv summaries) oneItRes_bio <- bioSum(oneItRes, byyear = FALSE) oneItRes_flt <- fltSum(oneItRes, byyear = FALSE) oneItRes_fltStk <- fltStkSum(oneItRes, byyear = FALSE) oneItRes_mt <- mtSum(oneItRes, byyear = FALSE) oneItRes_mtStk <- mtStkSum(oneItRes, byyear = FALSE) oneItRes_adv <- advSum(oneItRes) # Advice summary is only by year. oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) # Long format and seasonal oneItRes_bio <- bioSum(oneItRes, long = TRUE) # Biol summary is only by year. oneItRes_flt <- fltSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_fltStk <- fltStkSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_mt <- mtSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_mtStk <- mtStkSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_adv <- advSum(oneItRes, long = TRUE) # Advice summary is only by year. oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) oneItRes_risk <- riskSum( oneItRes, Bpa = c(stk1= 900), Blim = c(stk1 = 600), Prflim = c(fl1 = 0), scenario = 'alternative') oneItRes_npv <- npv(oneItRes, y0 = '2014') #------------------------------------------------ # Example Multi: Two stock, two fleet, four iters. #------------------------------------------------ # Wide format (default) multiRes_bio <- bioSum(multiRes) multiRes$fleets <- FLFleetsExt(lapply(multiRes$fleets, function(x) setUnitsNA(x))) multiRes_flt <- fltSum(multiRes) multiRes_fltStk <- fltStkSum(multiRes) multiRes_mt <- mtSum(multiRes) multiRes_mtStk <- mtStkSum(multiRes) multiRes_adv <- advSum(multiRes) multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) # Long format for a range of years multiRes_bio <- bioSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_flt <- fltSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_fltStk <- fltStkSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_mt <- mtSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_mtStk <- mtStkSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_adv <- advSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) # Wide format with seasonal disaggregation # (Note: No seasonal disagregation available for adv summaries) multiRes_bio <- bioSum(multiRes, byyear = FALSE) multiRes_flt <- fltSum(multiRes, byyear = FALSE) multiRes_fltStk <- fltStkSum(multiRes, byyear = FALSE) multiRes_mt <- mtSum(multiRes, byyear = FALSE) multiRes_mtStk <- mtStkSum(multiRes, byyear = FALSE) multiRes_adv <- advSum(multiRes) # Advice summary is only by year. multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) # Long format and seasonal multiRes_bio <- bioSum(multiRes, long = TRUE, byyear = FALSE) multiRes_flt <- fltSum(multiRes, long = TRUE, byyear = FALSE) multiRes_fltStk <- fltStkSum(multiRes, long = TRUE, byyear = FALSE) multiRes_mt <- mtSum(multiRes, long = TRUE, byyear = FALSE) multiRes_mtStk <- mtStkSum(multiRes, long = TRUE, byyear = FALSE) multiRes_adv <- advSum(multiRes, long = TRUE) # Advice summary is only by year. multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) multiRes_npv <- npv(multiRes, y0 = '2014') risk_multiRes <- riskSum( multiRes, Bpa = c(stk1= 135000, stk2 = 124000), Blim = c(stk1= 96000, stk2 = 89000), Prflim = c(fl1 = 0, fl2 = 0), scenario = 'alternative') ## End(Not run)
## Not run: library(FLBEIA) # Apply the summary functions to the examples runs in FLBEIA help page. # Test the different arguments in summary function. data(res_flbeia) #------------------------------------------------ # Example One: One stock, one fleet, one iter. #------------------------------------------------ # Wide format (default) oneRes_bio <- bioSum(oneRes) oneRes$fleets[[1]] <- setUnitsNA(oneRes$fleets[[1]]) oneRes_flt <- fltSum(oneRes) oneRes_fltStk <- fltStkSum(oneRes) oneRes_mt <- mtSum(oneRes) oneRes_mtStk <- mtStkSum(oneRes) oneRes_adv <- advSum(oneRes) head(oneRes_bio) head(oneRes_flt) head(oneRes_fltStk) head(oneRes_mt) head(oneRes_mtStk) head(oneRes_adv) oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) head(oneRes_bioQ) head(oneRes_fltQ) head(oneRes_fltStkQ) head(oneRes_mtQ) head(oneRes_mtStkQ) head(oneRes_advQ) # Long format for a range of years oneRes_bio <- bioSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_flt <- fltSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_fltStk <- fltStkSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_mt <- mtSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_mtStk <- mtStkSum(oneRes, long = TRUE, years = ac(2016:2020)) oneRes_adv <- advSum(oneRes, long = TRUE, years = ac(2016:2020)) head(oneRes_bio) head(oneRes_flt) head(oneRes_fltStk) head(oneRes_mt) head(oneRes_mtStk) head(oneRes_adv) oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) head(oneRes_bio) head(oneRes_flt) head(oneRes_fltStk) head(oneRes_mt) head(oneRes_mtStk) head(oneRes_adv) # Wide format with seasonal disaggregation # (Note: No seasonal disagregation available for adv summaries) oneRes_bio <- bioSum(oneRes, byyear = FALSE) oneRes_flt <- fltSum(oneRes, byyear = FALSE) oneRes_fltStk <- fltStkSum(oneRes, byyear = FALSE) oneRes_mt <- mtSum(oneRes, byyear = FALSE) oneRes_mtStk <- mtStkSum(oneRes, byyear = FALSE) oneRes_adv <- advSum(oneRes) # Advice summary is only by year. oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) # Long format and seasonal oneRes_bio <- bioSum(oneRes, long = TRUE) oneRes_flt <- fltSum(oneRes, long = TRUE, byyear = FALSE) oneRes_fltStk <- fltStkSum(oneRes, long = TRUE, byyear = FALSE) oneRes_mt <- mtSum(oneRes, long = TRUE, byyear = FALSE) oneRes_mtStk <- mtStkSum(oneRes, long = TRUE, byyear = FALSE) oneRes_adv <- advSum(oneRes, long = TRUE) # Advice summary is only by year. oneRes_bioQ <- bioSumQ(oneRes_bio) oneRes_fltQ <- fltSumQ(oneRes_flt) oneRes_fltStkQ <- fltStkSumQ(oneRes_fltStk) oneRes_mtQ <- mtSumQ(oneRes_mt) oneRes_mtStkQ <- mtStkSumQ(oneRes_mtStk) oneRes_advQ <- advSumQ(oneRes_adv) #------------------------------------------------ # Example OneIt: As one but with iterations. #------------------------------------------------ # Wide format (default) oneItRes_bio <- bioSum(oneItRes, scenario = 'with_iters') oneItRes$fleets[[1]] <- setUnitsNA(oneItRes$fleets[[1]]) oneItRes_flt <- fltSum(oneItRes, scenario = 'with_iters') oneItRes_fltStk <- fltStkSum(oneItRes, scenario = 'with_iters') oneItRes_mt <- mtSum(oneItRes, scenario = 'with_iters') oneItRes_mtStk <- mtStkSum(oneItRes, scenario = 'with_iters') oneItRes_adv <- advSum(oneItRes, scenario = 'with_iters') oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) # Long format for a range of years oneItRes_bio <- bioSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_flt <- fltSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_fltStk <- fltStkSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_mt <- mtSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_mtStk <- mtStkSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_adv <- advSum(oneItRes, long = TRUE, years = ac(2016:2020)) oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) # Wide format with seasonal disaggregation # (Note: No seasonal disagregation available for adv summaries) oneItRes_bio <- bioSum(oneItRes, byyear = FALSE) oneItRes_flt <- fltSum(oneItRes, byyear = FALSE) oneItRes_fltStk <- fltStkSum(oneItRes, byyear = FALSE) oneItRes_mt <- mtSum(oneItRes, byyear = FALSE) oneItRes_mtStk <- mtStkSum(oneItRes, byyear = FALSE) oneItRes_adv <- advSum(oneItRes) # Advice summary is only by year. oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) # Long format and seasonal oneItRes_bio <- bioSum(oneItRes, long = TRUE) # Biol summary is only by year. oneItRes_flt <- fltSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_fltStk <- fltStkSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_mt <- mtSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_mtStk <- mtStkSum(oneItRes, long = TRUE, byyear = FALSE) oneItRes_adv <- advSum(oneItRes, long = TRUE) # Advice summary is only by year. oneItRes_bioQ <- bioSumQ(oneItRes_bio) oneItRes_fltQ <- fltSumQ(oneItRes_flt) oneItRes_fltStkQ <- fltStkSumQ(oneItRes_fltStk) oneItRes_mtQ <- mtSumQ(oneItRes_mt) oneItRes_mtStkQ <- mtStkSumQ(oneItRes_mtStk) oneItRes_advQ <- advSumQ(oneItRes_adv) oneItRes_risk <- riskSum( oneItRes, Bpa = c(stk1= 900), Blim = c(stk1 = 600), Prflim = c(fl1 = 0), scenario = 'alternative') oneItRes_npv <- npv(oneItRes, y0 = '2014') #------------------------------------------------ # Example Multi: Two stock, two fleet, four iters. #------------------------------------------------ # Wide format (default) multiRes_bio <- bioSum(multiRes) multiRes$fleets <- FLFleetsExt(lapply(multiRes$fleets, function(x) setUnitsNA(x))) multiRes_flt <- fltSum(multiRes) multiRes_fltStk <- fltStkSum(multiRes) multiRes_mt <- mtSum(multiRes) multiRes_mtStk <- mtStkSum(multiRes) multiRes_adv <- advSum(multiRes) multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) # Long format for a range of years multiRes_bio <- bioSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_flt <- fltSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_fltStk <- fltStkSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_mt <- mtSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_mtStk <- mtStkSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_adv <- advSum(multiRes, long = TRUE, years = ac(2016:2020)) multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) # Wide format with seasonal disaggregation # (Note: No seasonal disagregation available for adv summaries) multiRes_bio <- bioSum(multiRes, byyear = FALSE) multiRes_flt <- fltSum(multiRes, byyear = FALSE) multiRes_fltStk <- fltStkSum(multiRes, byyear = FALSE) multiRes_mt <- mtSum(multiRes, byyear = FALSE) multiRes_mtStk <- mtStkSum(multiRes, byyear = FALSE) multiRes_adv <- advSum(multiRes) # Advice summary is only by year. multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) # Long format and seasonal multiRes_bio <- bioSum(multiRes, long = TRUE, byyear = FALSE) multiRes_flt <- fltSum(multiRes, long = TRUE, byyear = FALSE) multiRes_fltStk <- fltStkSum(multiRes, long = TRUE, byyear = FALSE) multiRes_mt <- mtSum(multiRes, long = TRUE, byyear = FALSE) multiRes_mtStk <- mtStkSum(multiRes, long = TRUE, byyear = FALSE) multiRes_adv <- advSum(multiRes, long = TRUE) # Advice summary is only by year. multiRes_bioQ <- bioSumQ(multiRes_bio) multiRes_fltQ <- fltSumQ(multiRes_flt) multiRes_fltStkQ <- fltStkSumQ(multiRes_fltStk) multiRes_mtQ <- mtSumQ(multiRes_mt) multiRes_mtStkQ <- mtStkSumQ(multiRes_mtStk) multiRes_advQ <- advSumQ(multiRes_adv) multiRes_npv <- npv(multiRes, y0 = '2014') risk_multiRes <- riskSum( multiRes, Bpa = c(stk1= 135000, stk2 = 124000), Blim = c(stk1= 96000, stk2 = 89000), Prflim = c(fl1 = 0, fl2 = 0), scenario = 'alternative') ## End(Not run)
Function to estimate reference points when having a seasonal model
brpsson( stk, B0, R0, rec.ss = 1, ssb.ss = 1, sr_model, sr_params, Fprop = rep(1/dim(stk)[4], dim(stk)[4]), Fscan = seq(0, 4, by = 0.01), oldest = 100, nrun = 200, tol = 0.01 )
brpsson( stk, B0, R0, rec.ss = 1, ssb.ss = 1, sr_model, sr_params, Fprop = rep(1/dim(stk)[4], dim(stk)[4]), Fscan = seq(0, 4, by = 0.01), oldest = 100, nrun = 200, tol = 0.01 )
stk |
An FLStock object. |
B0 |
The value of the virgin biomass. |
R0 |
The expected recrutiment in the virgin population. |
rec.ss |
The recruitment season (numeric). Default value = 1. |
ssb.ss |
The spawning season (numeric). Default value = 1. |
sr_model |
A character with the name of the model to simulate the recruitment process. |
sr_params |
A named vector with the SR parameter values. |
Fprop |
A vector with the same length as the number of seasons with the proportion of F by season. By default the same proportion in all the seasons is assumed. |
Fscan |
A vector with the F values to be simulated. By default, will scan values between 0 and 4 (by 0.01 increments). |
oldest |
The maximum age class to be considered. Default 100. |
nrun |
The maximum number of years to project forward until equilibrium. |
tol |
The desired accuracy. |
library(FLBEIA) data(multistk) # object with 2 seasons and 3 iterations stk <- trim( multistk, year=1, iter = 1) # loop for different catch proportions by season for (p in seq(0.1,0.9,0.1)) { fruns <- brpsson( stk, B0=1e+05, R0=27489766, rec.ss=2, ssb.ss=2, sr_model="bevholt", sr_params=c( a = 29988835.109, b = 9090.909), Fprop = c(p, 1-p)) } plotBRPsson( fruns, pdfnm="stk_Fbar_vs_SPR.pdf")
library(FLBEIA) data(multistk) # object with 2 seasons and 3 iterations stk <- trim( multistk, year=1, iter = 1) # loop for different catch proportions by season for (p in seq(0.1,0.9,0.1)) { fruns <- brpsson( stk, B0=1e+05, R0=27489766, rec.ss=2, ssb.ss=2, sr_model="bevholt", sr_params=c( a = 29988835.109, b = 9090.909), Fprop = c(p, 1-p)) } plotBRPsson( fruns, pdfnm="stk_Fbar_vs_SPR.pdf")
Given stock abundances and catches (i.e. landings and discards), this function estimates values for
fleets[[fl]]@metiers[[mt]]@catches[[st]]@catch.q
,
fleets[[fl]]@metiers[[mt]]@catches[[st]]@landings.sel
, and
fleets[[fl]]@metiers[[mt]]@catches[[st]]@discards.sel
for all years except the simulation years. For the simulation years,
the parameter values are set as the mean of the parameters along mean.yrs
.
calculate.q.sel.flrObjs(biols, fleets, BDs, fleets.ctrl, mean.yrs, sim.yrs)
calculate.q.sel.flrObjs(biols, fleets, BDs, fleets.ctrl, mean.yrs, sim.yrs)
biols |
An FLBiols object. |
fleets |
An FLFleetsExt object. An extended version of the FLFleet object defined in FLCore. |
BDs |
A list of FLSRsim objects. One per biomass dynamic stock in biols object. |
fleets.ctrl |
Fleets' control file containing the catch production function for each fleet and stock. |
mean.yrs |
A character vector with the name of the years used to calculate mean selectivity. |
sim.yrs |
A character vector with the name of the years in the projection period. |
A FLFleetsExt object.
This functions checks wether some conditions are met for the inputs in the different arguments of the FLBEIA function. There are also checking functions for specific inputs: biols, fleets, SRs, advice, and obs.ctrl arguments.
Functions available:
checkFLBEIAData
: for checking inputs for differents arguments of FLBEIA function
(of class FLBiols).
checkBiols
: for checking biols argument of FLBEIA function
(of class FLBiols).
checkFleets
: for checking fleets argument of FLBEIA function
(of class FLFleetsExt).
checkSRs
: for checking SRs argument of FLBEIA function
(list of FLSRsim objects).
checkAdvice
: for checking advice argument of FLBEIA function
(of class list with two FLQuant elements, TAC and quota.share).
checkObsctrl
: for checking obs.ctrl argument of FLBEIA function
(of class list).
checkFLBEIAData( biols, SRs = NULL, BDs = NULL, fleets, covars = NULL, indices = NULL, advice = NULL, main.ctrl, biols.ctrl, fleets.ctrl, covars.ctrl, obs.ctrl, assess.ctrl, advice.ctrl ) checkBiols(object) checkFleets(object, ctrl = NULL) checkSRs(object) checkBDs(object) checkAdvice(object) checkObsctrl(object)
checkFLBEIAData( biols, SRs = NULL, BDs = NULL, fleets, covars = NULL, indices = NULL, advice = NULL, main.ctrl, biols.ctrl, fleets.ctrl, covars.ctrl, obs.ctrl, assess.ctrl, advice.ctrl ) checkBiols(object) checkFleets(object, ctrl = NULL) checkSRs(object) checkBDs(object) checkAdvice(object) checkObsctrl(object)
biols |
An FLBiols object. |
SRs |
A list of FLSRsim objects. |
BDs |
A list of FLBDsim objects. |
fleets |
An FLFleetsExt object. |
covars |
A list of FLQuants. |
indices |
A list of FLIndices. |
advice |
A list with two FLQuant elements, TAC and quota.share. |
main.ctrl |
A list with the settings to control the main function. |
biols.ctrl |
A list with the settings to control the biological operating model for each stock. |
fleets.ctrl |
A list with the settings to control the fleets operating model for each fleet. |
covars.ctrl |
A list with the settings to control the covars operating model for each fleet. |
obs.ctrl |
A list with the settings to control the observation model for each stock. |
assess.ctrl |
A list with the settings to control the specify the assessment model for each stock. |
advice.ctrl |
A list with the settings to control the advice model for each stock. |
object |
An object of the appropiate class depending on the FLBEIA argument to be checked:
|
ctrl |
An object of class list (optional argument), input for fleets.ctrl argument of FLBEIA function. |
An error message if there is any error detected.
It creates the advice.ctrl object to be used in the call to the main function FLBEIA.
create.advice.ctrl(stksnames, HCR.models = NULL, ...)
create.advice.ctrl(stksnames, HCR.models = NULL, ...)
stksnames |
A vector with the name of the stocks in the OM. |
HCR.models |
A character vector of the same length as stksnames with the name of the HCR used to generate the management advice. |
... |
any extra arguments necessary in the HCR specific creators. '...' are extracted using 'list(...)', this generates a named list with the extra arguments. To assure the correct functioning the extra arguments must have a name. |
A list of lists with the basic structure of the advice.ctrl object.
create.advice.data function creates a list (elements: TAC, TAE and quota.share)
create.advice.data(yrs, ns, ni, stks.data, fleets)
create.advice.data(yrs, ns, ni, stks.data, fleets)
yrs |
A vector with c(first.yr,proj.yr, last.yr) where
|
ns |
Number of seasons (number). |
ni |
Number of iterations (number). |
stks.data |
A list with the names of the stocks and the following elements: Optionals:
|
fleets |
Optional argument only required if stk_advice.quota.share is not specified. It could be the output of create_fleets_FLBEIA function (FLFleets). |
A list with TAC, TAE and quota.share elements.
It creates the assess.ctrl object to be used in the call to the main function FLBEIA.
create.assess.ctrl(stksnames, assess.models = NULL, assess.ctrls = NULL, ...)
create.assess.ctrl(stksnames, assess.models = NULL, assess.ctrls = NULL, ...)
stksnames |
A vector with the name of the stocks in the OM. |
assess.models |
A character vector of the same length as stksnames with the name of the model used to obtaine the perceived population in the MP. |
assess.ctrls |
A list of the same length as stksnames with the arguments needed to fit the assessment model. |
... |
any extra arguments necessary in the model specific creators. '...' are extracted using 'list(...)', this generates a named list with the extra arguments. To assure the correct functioning the extra arguments must have a name. |
A list of lists with the basic structure of the assess.ctrl object.
create.BDs.data function creates a list of FLBDsim objects.
create.BDs.data(yrs, ns, ni, stks.data)
create.BDs.data(yrs, ns, ni, stks.data)
yrs |
A vector with c(first.yr,proj.yr, last.yr) where:
|
ns |
Number of seasons (number). |
ni |
Number of iterations (number). |
stks.data |
A list with the name of the stks and the following elements:
Optionals:
|
A list of FLBDsim objects.
This function generates an FLBiol object, given the data inputs as arrays. Supported formats are Excel (xls and xlsx) and R format (RData).
create.biol.arrays( filename = NULL, data = NULL, name = NA, ages, hist.yrs, sim.yrs, fbar = NULL, mean.yrs, source = "rdata", unit = list() )
create.biol.arrays( filename = NULL, data = NULL, name = NA, ages, hist.yrs, sim.yrs, fbar = NULL, mean.yrs, source = "rdata", unit = list() )
filename |
A character vector with the name of the files containing the stock data.
Supported formats are Excel (xls and xlsx) and R format (RData).
In case of using R format, the information must be stored in |
data |
An R object with the stock data. |
name |
A character (optional) with the name of the stock. |
ages |
A numeric vector with the age classes of stock. |
hist.yrs |
A vector with the historical years. |
sim.yrs |
A vector with the simulation years. |
fbar |
A numeric vector with the age range (min,max) to be used for estimating average fishing mortality. |
mean.yrs |
A vector with the years used to compute the mean to condition the parameters in the projection period. |
source |
Character, 'excel', 'rdata', 'FLStock' or 'object'. 'rdata' (default) if an RData object is used, 'excel' if the data is provided in an Excel file, 'FLStock' if the data is provided in and FLSTock object and 'object' if the data is an object of the working environment. |
unit |
A list with the units of the different elements included in |
An FLBiol
.
Dorleta Garcia & Sonia Sanchez.
It creates the biols.ctrl object to be used in the call to the main function FLBEIA.
create.biols.ctrl(stksnames, growth.models = NULL, immediate = FALSE, ...)
create.biols.ctrl(stksnames, growth.models = NULL, immediate = FALSE, ...)
stksnames |
A vector with the name of the stocks in the OM. |
growth.models |
A character vector of the same length as stksnames with the name of the model used to project the stock populations in the simulation. |
immediate |
logical, indicating if the warnings should be output immediately. |
... |
any extra arguments necessary in the model specific creators. '...' are extracted using 'list(...)', this generates a named list with the extra arguments. To assure the correct functioning the extra arguments must have a name. |
A list of lists with the basic structure of the biols.ctrl object.
create.biols.data function creates an FLBiols object.
create.biols.data(yrs, ns, ni, stks.data)
create.biols.data(yrs, ns, ni, stks.data)
yrs |
A vector with c(first.yr,proj.yr, last.yr) where
|
ns |
Number of seasons (number). |
ni |
Number of iterations (number). |
stks.data |
A list with the name of the stks and the following elements:
|
An FLBiol object
It creates the covars.ctrl object to be used in the call to the main function FLBEIA.
create.covars.ctrl( cvrsnames, process.models = NULL, flq, immediate = FALSE, ... )
create.covars.ctrl( cvrsnames, process.models = NULL, flq, immediate = FALSE, ... )
cvrsnames |
A vector with the name of the covariates in the OM. |
process.models |
A character vector of the same length as cvrsnames with the name of the process model followed by each of the covariates. The first element corresponds with the process model of the first covariable in cvrsnames, the second with the second and so on. The default is NULL in which case 'fixedCovar' is used for **all** the covariates. |
flq |
An FLQuant to give structure to the FLQuants to be used within the function, the dimension and dimnames in 'year', 'season' and 'iter' will be used to create the necessary FLQuants. |
immediate |
logical, indicating if the warnings should be output immediately. |
... |
any extra arguments necessary in the HCR specific creators. '...' are extracted using 'list(...)', this generates a named list with the extra arguments. To assure the correct functioning the extra arguments must have a name. |
A list of lists with the basic structure of the covars.ctrl object.
This function generates an covar object with the economic indicators and fills in vcost, fcost, capacity and crewshare slots in FLFleets object. The data is given in excel File (xls and xlsx).
create.ecoData(file, fltObj, hist.yrs, mean.yrs, sim.yrs)
create.ecoData(file, fltObj, hist.yrs, mean.yrs, sim.yrs)
file |
An excel file with the economic data. The names used for the sheets and the columns must be the same used to name fleets and metiers in fltObj. However, the fleets in the excel file can be a subset of the fleets in the fleetsObj, i.e., is not neccesary to provide economic data for all the fleets. The order of metiers in the columns data must correspond with the name of the metiers used in the FLFleet object. |
fltObj |
An FLFleets object with the structure of the fleet and which may contain historical data. |
hist.yrs |
A vector with the historical years. |
mean.yrs |
A vector with the years used to compute the mean to condition the parameters in the projection period. |
sim.yrs |
A vector with the simulation years. |
An /codeFLFleetsExt.
Dorleta Garcia & Sonia Sanchez.
FLFleetsExt
, create.biol.arrays
This function generates an FLFleetsExt object, given the data inputs as arrays. Supported formats are Excel (xls and xlsx) and R format (RData).
create.fleets.arrays( stk_objs, caa_objs, caa_objs_path, price_objs, price_objs_path, catch_obj, effort_obj, flt_obj = NULL, stk_nms = NA, flt_nms, flt_mt_nms, flt_mt_stk_nms, ages = NULL, hist.yrs, sim.yrs, mean.yrs, new_hist.yrs = hist.yrs, update_catch_effort = TRUE, update_price = TRUE, update_weight = TRUE, caa_flt_mt_correspondences = NULL, paa_flt_mt_correspondences = NULL, caaOpt, priceOpt, excel = TRUE )
create.fleets.arrays( stk_objs, caa_objs, caa_objs_path, price_objs, price_objs_path, catch_obj, effort_obj, flt_obj = NULL, stk_nms = NA, flt_nms, flt_mt_nms, flt_mt_stk_nms, ages = NULL, hist.yrs, sim.yrs, mean.yrs, new_hist.yrs = hist.yrs, update_catch_effort = TRUE, update_price = TRUE, update_weight = TRUE, caa_flt_mt_correspondences = NULL, paa_flt_mt_correspondences = NULL, caaOpt, priceOpt, excel = TRUE )
stk_objs |
A character vector with the names of the files containing the stocks data. See create.biol.arrays for more detail. Supported format is only Excel (xls and xlsx), each stock can be in different format. |
caa_objs |
A character vector with the names of the files containing the catch at age data (in numbers), both for landings and discards.
Supported formats are Excel (xls and xlsx) and R format (RData), each file can be in different format.
The number of required files depend of the value of
If NULL, the function looks for "caa_stknm_flnm.xlsx" in |
caa_objs_path |
A character vector with the |
price_objs |
A character vector with the names of the files containing the price at age data.
Supported formats are Excel (xls and xlsx) and R format (RData), each prices file can be in different format.
The number of required files depend of the value of
|
price_objs_path |
A character vector with the price_objs file path. |
catch_obj |
A character vector with the names of the files containing the catch data in Fcube format. Supported formats are Excel (xls and xlsx) and R format (RData) and required columns are 'year', 'fleet', 'metier', 'stock', 'category' and 'catch'. |
effort_obj |
A character vector with the names of the files containing the effort data in Fcube format.
Supported formats are Excel (xls and xlsx) and R format (RData) and required columns are 'year', 'fleet', 'metier' and 'effort'.
Both |
flt_obj |
An FLFleets object (optional) with the structure of the fleet and which may contain historical data.
If this object is provided, then the arguments |
stk_nms |
A character vector (optional) with the name of all the stocks caugth by the different fleets. |
flt_nms |
A character vector with the name of the fleets. |
flt_mt_nms |
A list with one element per fleet. In turn, each element is a character vector with the names of the metiers in the corresponding fleet. |
flt_mt_stk_nms |
A list with one element per fleet and metier. In turn, each element is a character vector with the names of the stocks in the corresponding fleet and metier. |
ages |
A list with one element per stock, with the age classes of the stock. |
hist.yrs |
A vector with the historical years. |
sim.yrs |
A vector with the simulation years. |
mean.yrs |
A vector with the years used to compute the mean to condition the parameters in the projection period. |
new_hist.yrs |
A vector with the years from input files that will be used to condition the parameters in the historic years.
If a value is not provided, the it is set equal to |
update_catch_effort |
Logical. If |
update_price |
Logical. If |
update_weight |
Logical. If |
caa_flt_mt_correspondences |
An Excel file name. This file must contain one sheet per stock, with the correspondences between the fleet segments used in |
paa_flt_mt_correspondences |
An Excel file name. This file must contain information on prices correspondences, with same format and requirements as |
caaOpt |
A code number to determine the way in wich catch at age data are provided. The option to be used depends on the data availabiltiy, from data rich to data-poor and the following codes are available:
|
priceOpt |
A code number to determine the way in wich price at age data are provided. The option to be used depends on the data availabiltiy, from data rich to data-poor and the following codes are available:
|
excel |
Logical. If |
An FLFleetsExt
.
Dorleta Garcia & Sonia Sanchez.
FLFleetsExt
, create.biol.arrays
It creates the fleets.ctrl object to be used in the call to the main function FLBEIA.
create.fleets.ctrl( fls, n.fls.stks, fls.stksnames, catch.threshold = NULL, seasonal.share = NULL, effort.models = NULL, capital.models = NULL, catch.models = NULL, price.models = NULL, flq, ... )
create.fleets.ctrl( fls, n.fls.stks, fls.stksnames, catch.threshold = NULL, seasonal.share = NULL, effort.models = NULL, capital.models = NULL, catch.models = NULL, price.models = NULL, flq, ... )
fls |
character vector with fleet names |
n.fls.stks |
numeric vector with the same length as fls with the declaration of the number of stocks caugth by each of the fleets. |
fls.stksnames |
character vector with length = sum(n.fls.stks), with the names of the stocks caught by the fleet, the vector must follow the order used in the previous argument.
|
catch.threshold |
if(NULL) => 0.9 for all the stocks (NULL is the default) else it must be an FLQuant with dim = c(nstks,ny,1,ns,nit) |
seasonal.share |
an FLQuant with dimension [num. fleets, num. years, 1,num. seasons, 1, num. iterations] with elements between 0 and 1 to indicate how the quota of each fleet is distributed along seasons. The sum along seasons (seasonSums) must return an FLQuant with all elements equal to 1. |
effort.models |
characted vector with the same length as fls with the effort model followed by each of the fleet. the first element correspond with the effort model of the first fleet in fls, the second with the second and so on. The default is NULL in which case 'fixedEffort' is used for **all** the fleets. |
capital.models |
characted vector with the same length as fls with the capital model followed by each of the fleet. the first element correspond with the capital model of the first fleet in fls, the second with the second and so on. The default is NULL in which case 'fixedCapital' is used for **all** the fleets. |
catch.models |
characted vector with the same length as sum(n.fls.stks) with the catch model followed by each of the fleet for each stock. the first element correspond with the catch model of the first fleet in fls and the first stock in fls.stksnames, the second with the second and so on. The default is NULL in which case 'CobbDouglasAge' is used for **all** the fleets. |
price.models |
characted vector with the same length as sum(n.fls.stks) with the price model followed by each of the fleet for each stock. the first element correspond with the price model of the first fleet in fls and the first stock in fls.stksnames, the second with the second and so on. The default is NULL in which case 'fixedPrice' is used for **all** the fleets. |
flq |
An FLQuant to give structure to the FLQuants to be used within the function, the dimension and dimnames in 'year', 'season' and 'iter' will be used to create the necessary FLQuants. |
... |
Any extra arguments necessary in the model specific creators. '...' are extracted using 'list(...)', this generates a named list with the extra arguments. To assure the correct functioning the extra arguments must have a name, for example, elas = FLQuant(1,dimnames = DimsNms). |
A list of lists with the basic structure of the fleets.ctrl object.
create.fleets.data function creates an FLFleetsExt object
create.fleets.data(yrs, ns, ni, fls.data, stks.data)
create.fleets.data(yrs, ns, ni, fls.data, stks.data)
yrs |
A vector with c(first.yr,proj.yr, last.yr) where
|
ns |
Number of seasons (number). |
ni |
Number of iterations (number). |
fls.data |
A list with the name of the fleets and the following elements:
Optionals:
|
stks.data |
A list with the name of the stocks and with the next elements:
Optionals:
|
An FLFleetsExt object.
create.indices.data function creates an FLIndices object
create.indices.data(yrs, ns, ni, stks.data)
create.indices.data(yrs, ns, ni, stks.data)
yrs |
A vector with c(first.yr,proj.yr, last.yr) where
|
ns |
Number of seasons (number). |
ni |
Number of iterations (number). |
stks.data |
A list with the names of the stocks with indices and the following elements:
Optionals:
|
An FLIndices object.
It creates the obs.ctrl object to be used in the call to the main function FLBEIA.
create.obs.ctrl( stksnames, n.stks.inds = NULL, stks.indsnames = NULL, stkObs.models = NULL, indObs.models = NULL, immediate = FALSE, ... )
create.obs.ctrl( stksnames, n.stks.inds = NULL, stks.indsnames = NULL, stkObs.models = NULL, indObs.models = NULL, immediate = FALSE, ... )
stksnames |
A vector with the name of the stocks in the OM. |
n.stks.inds |
numeric vector with the same length as stksnames with the declaration of the number of abundance indices per stock, the order must be the same used in stksnames. |
stks.indsnames |
NULL or a character vector of length equal to sum(n.stks.inds) with the names of the indices per stock. The order must be the same used in the previous arguments. |
stkObs.models |
A character vector of the same length as stksnames with the name of the model used to observed stock data. |
indObs.models |
A character vector of the same length as stks.indsnames with the name of the model used to generate the abundance indices. |
immediate |
logical, indicating if the warnings should be output immediately. |
... |
any extra arguments necessary in the model specific creators. '...' are extracted using 'list(...)', this generates a named list with the extra arguments. To assure the correct functioning the extra arguments must have a name. |
A list of lists with the basic structure of the obs.ctrl object.
create.BDs.data function creates a list of FLBDsim objects
create.SRs.data(yrs, ns, ni, stks.data)
create.SRs.data(yrs, ns, ni, stks.data)
yrs |
A vector with c(first.yr,proj.yr, last.yr) where:
|
ns |
Number of seasons (number). |
ni |
Number of iterations (number). |
stks.data |
A list with the name of the stks and the following elements:
Optionals:
|
A list of FLSRsim objects.
Example datasets for the classes defined in FLBEIA.
one
: A dataset for running FLBEIA.
Example with one stock (age-structured), one fleet, annual steps (one season) and one iteration.
oneBio
(FLBiols
)
: Biological information on the stock. In this case, the stock is age-structured.
oneSR
(FLSRsim
)
: Stock-recruitment model for the stock in oneBio
object.
oneFl
(FLFleetsExt
)
: Information on the fleet and the metier considered.
oneCv
(list
of FLQuants
)
: Covariates information. In this case all are economic indicators.
oneIndAge
and oneIndBio
(list
of FLIndices
)
: Indices, if avalable, for the different stocks in oneBio
.
Where oneIndAge
and oneIndBio
are indices with estimates in numbers at age and total biomass, respectively.
oneAdv
(list
)
: Information on TAC and quota share.
oneMainC
(list
)
: Settings to control the main function FLBEIA
. The simulation years.
oneBioC
(list
)
: Settings to control the biological operating model for the stock in oneBio
object.
oneFlC
(list
)
: Settings to control the fleet operating model for the fleet in oneFl
object.
oneCvC
(list
)
: Settings to control the covar operating model for each covariate in covars
object.
In this case all the covariates are fixed.
oneObsC
, oneObsCIndAge
and oneObsCIndBio
(list
)
: Settings to control the observation model for the stock in oneBio
object.
In oneObsC
the stock is observed without error and there are no indices available.
Alternative control settings are available for cases when indices are observed, oneObsCIndAge
and oneObsCIndBio
.
oneAssC
(list
)
: Settings to control the assessment model for each stock in oneBio
object.
In this case, no assessment is carried out.
oneAdvC
(list
)
: Settings to control the advice model for the stock in oneBio
object.
oneIt
: A dataset for running FLBEIA.
Same as one
dataset, but with three iterations.
multi
: A dataset for running FLBEIA.
Example with two stocks (one age-structured and the other in biomass),
two fleets (with 2 metiers each), four seasons and one iteration.
multiBio
(FLBiols
)
: Biological information on the stocks (one is age-structured and the other one in total biomass).
multiSR
(FLSRsim
)
: Stock-recruitment models for the age-structured stock in multiBio
object.
In this case a Beverton-Holt (bevholt
) is selected.
multiBD
(FLSRsim
)
: Biomass dynamic model for the stock in biomass in multiBio
object.
In this case Pella-Tomlinson model (PellaTom
) is selected.
multiFlC
(FLFleetsExt
)
: Information on the fleets and metiers.
In this case there are two fleets, each one with two metiers, all of them capturing both stocks in multiBio
object.
multiCv
(list
of FLQuants
)
: Covariates information. In this case all are economic indicators.
multiAdv
(list
)
: Information on TAC and quota share.
multiMainC
(list
)
: Settings to control the main function FLBEIA
.
multiBioC
(list
)
: Settings to control the biological operating model for each stock in multiBio
object.
multiFlC
(list
)
: Settings to control the fleet operating model for each fleet in fleets
object.
multiCvC
(list
)
: Settings to control the covar operating model for each covariate in covars
object.
In this case all the covariates are fixed.
multiObsC
(list
)
: Settings to control the observation model for each stock in multiBio
object.
In this case the stock is observed without error and there are no indices available.
multiAssC
(list
)
: Settings to control the assessment model for each stock in multiBio
object.
In this case, no assessment is carried out.
multiAdvC
(list
)
: Settings to control the advice model for each stock in multiBio
object.
res_flbeia
: A dataset with the outputs of FLBEIA runs given as input the different datasets (one, oneIt and multi).
oneRes
(list
)
: Output of the FLBEIA function, given as input the data in the one
dataset.
onIteRes
(list
)
: Output of the FLBEIA function, given as input the data in the oneIt
dataset.
multiRes
(list
)
: Output of the FLBEIA function, given as input the data in the multi
dataset.
mur
: A dataset for Stripped Red Mullet in the Bay of Biscay.
Information on catch and abundance indices from Evohe survey.
catch
(data.frame
)
: The total catch time series data by area from WGBIE report (ICES, 2017).
Total catch data is available since 1975. In 1999 France did not report any data.
As France is the main contributor to the total catch, the 1999 catch data was not included in the analysis.
evhoe
(data.frame
)
: EVHOE abundance index time series, provided by Ifremer.
The abundance index is available since 1997 and provides an estimation of the biomass together with a coefficient of variation.
multistk
: A dataset with an FLStock with multiple dimensions.
multistk
(FLStock
)
: FLStock object with 2 seasons and 3 iterations.
Datasets can be loaded by issuing the data
command, like in:
data(one)
.
All available datasets can be checked by: data(package='FLBEIA')
.
ICES, 2017
FLBEIA
, FLBiols
, FLFleetsExt
,
FLSRsim
, FLIndices
, FLQuant
data(one) data(res_flbeia)
data(one) data(res_flbeia)
These functions return the biomass (B), fishing mortality (F), spawning stock biomass (SSB), recruitment (R), catches (C), landings (L) and discards (D) indicators. Also indicators comparing the reference points with the actual values, Bpa, Blim, Btarget, Fpa, Flim and Ftarget, so the biomass indicators are TRUE if the biomass is above them, and the fishing mortality indicators are TRUE if the fishing mortality is below them. ssb2Btarget and f2Ftarget return the ratio between SSB and F and the target reference point.
ecoSum_damara(fleets, flnms = "all", years, covars = NULL) F_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) SSB_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) B_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) R_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) C_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) L_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) D_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) summary_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year)
ecoSum_damara(fleets, flnms = "all", years, covars = NULL) F_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) SSB_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) B_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) R_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) C_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) L_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) D_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year) summary_flbeia(obj, years = dimnames(obj$biols[[1]]@n)$year)
fleets |
A FLFleetsExt object. |
flnms |
Names of the fleet for which the indicators will be calculated. |
years |
The years for which the indicators are extracted. |
covars |
List of FLQuants with information on covariates. |
obj |
The output of the FLBEIA function. |
B_flbeia this function computes SSB.
F_flbeia this function computes fishing mortiality.
SSB_flbeia this function computes spawning stock biomass by species.
R_flbeia this function computes recruitment by stock. If the stock is defined by age this function the recruiment is computed. ; If the stock is follows a biomass dynamics, this function gives the growth.
C_flbeia this function computes catches by fleets and stock.
L_flbeia this function computes landings by fleets and stock.
D_flbeia this function computes the discards by fleets and stock.
summary_flbeia this function computes recruitment, SSB, fishing mortality, total biomass for all stocks; and catch and landings for all fleets by year and stock.
B_flbeia, F_flbeia... return an array with three dimensions (stock, year and iter). The summary_flbeia function returns an array with 4 dimensions (stock, year, iter, indicator) with the value of all the indicators.
The output can be used for the brp argument of bioSum
function.
extractBRP(advice.ctrl, stkn, Btarget = NULL, Ftarget = NULL)
extractBRP(advice.ctrl, stkn, Btarget = NULL, Ftarget = NULL)
advice.ctrl |
A list with advice controls as the FLBEIA function argument advice.ctrl. |
stkn |
Names of the stocks. |
Btarget |
Named vector with the name of the target biological reference point for each element in stkn. Default "Bmsy". |
Ftarget |
Named vector with the name of the target fishing mortality reference point for each element in stkn. Default "Fmsy". |
A data frame with columns stock, iter and one colum per reference point with the value of the biological reference points per stock and iteration. The used reference points are Bpa, Blim, Bmsy, Fpa, Flim and Fmsy.
## Not run: library(FLBEIA) data(one) extractBRP(oneAdvC, stkn = names(oneBio)) data(oneIt) extractBRP(oneItAdvC, stkn = names(oneItBio)) data(multi) extractBRP(multiAdvC, stkn = names(multiBio)) # setting targets different to Bmsy and Fmsy extractBRP(oneAdvC, stkn = names(oneBio), Btarget=setNames("Btrigger","stk1"), Ftarget=setNames("Ftrigger","stk1")) Btarget <- setNames(c("Btrigger","Bmsy"),names(oneBio)) Ftarget <- setNames(c("Ftrigger","Fmsy"),names(oneBio)) extractBRP(multiAdvC, stkn = names(multiBio)) ## End(Not run)
## Not run: library(FLBEIA) data(one) extractBRP(oneAdvC, stkn = names(oneBio)) data(oneIt) extractBRP(oneItAdvC, stkn = names(oneItBio)) data(multi) extractBRP(multiAdvC, stkn = names(multiBio)) # setting targets different to Bmsy and Fmsy extractBRP(oneAdvC, stkn = names(oneBio), Btarget=setNames("Btrigger","stk1"), Ftarget=setNames("Ftrigger","stk1")) Btarget <- setNames(c("Btrigger","Bmsy"),names(oneBio)) Ftarget <- setNames(c("Ftrigger","Fmsy"),names(oneBio)) extractBRP(multiAdvC, stkn = names(multiBio)) ## End(Not run)
A class to simulate the growth of populations aggregated in biomass.
... |
Empty or FLQuants for 'biomass', 'catch' and 'uncertainty' slots and optionally the values for the rest of the slots. |
The FLBDsim has the following slots:
An object of class FLBDsim.
name
The name of the stock.
desc
A description of the object.
range
The range of the object.
biomass
An FLQuant to store the biomass of the stock.
gB
An FLQuant to store the surplus production of the stock.
catch
An FLQuant to store the catch of the stock.
uncertainty
An FLQuant to store the uncertainty that is multiplied to the biomass in every step of the simulation.
covar
An FLQuants to store the covariates that are part of the growth model.
model
A character with the name of the model to simulate the recruitment process.
params
An array with dimension [numb.params, numb.year, numd.season, numb.iteration] with year and season and iteration dependent parameters of the growth model.
alpha
An array with dimension [numb.year, numd.season, numb.iteration] with year, season and iteration dependent value bigger than one which indicates, in percentage, how big can be the biomass in comparison with the carrying capacity.
name
The name of the object.
desc
Character with the description of the object.
range
A numeric vector with the range of the object as in other FLR objects.
FLBEIA is a simulation model that describes a fishery system under a Management Strategy Evaluation framework.The objective of the model is to facilitate the Bio-Economic evaluation of Management strategies. The model is multistock, multifleet and seasonal. The simulation is divided in 2 main blocks, the Operating Model (OM) and the Management Procedure (MP). In turn, the OM is divided in 3 components, the biological, the fleets and the covariables component. The MP is also divided in 3 components, the observation, the assessment and the advice.
FLBEIA( biols, SRs = NULL, BDs = NULL, fleets, covars = NULL, indices = NULL, advice = NULL, main.ctrl, biols.ctrl, fleets.ctrl, covars.ctrl, obs.ctrl, assess.ctrl, advice.ctrl )
FLBEIA( biols, SRs = NULL, BDs = NULL, fleets, covars = NULL, indices = NULL, advice = NULL, main.ctrl, biols.ctrl, fleets.ctrl, covars.ctrl, obs.ctrl, assess.ctrl, advice.ctrl )
biols |
An FLBiols object. |
SRs |
A list of FLSRsim objects. One per age structured stock in biols object. |
BDs |
A list of FLBDsim objects. One per biomass dynamic stock in biols object. |
fleets |
An FLFleetsExt object. An extended version of the FLFleet object defined in FLCore. |
covars |
A list of FLQuants used to store any kind of variables that are used within the simulation and are not stored in the standard objects. |
indices |
A list of FLIndices. Each element must correspond with one of the stocks in biols object. |
advice |
A list with two FLQuant elements, TAC and quota.share. TAC is an FLQuant with quant dimension equal to the number of stocks in biols object, the names used in in the quant dimension must be equal to those used in biols. quota.share is a list with one element per stock in biols object indicating the quota share per stock and fleet. The quant dimension of the elements must be equal to the number of fleets and the names used must be equal to those in fleets objects. |
main.ctrl |
A list with the settings to control the main function (the year range,...). |
biols.ctrl |
A list with the settings to control the biological operating model for each stock (the population dynamic model used, additional parameters,...) |
fleets.ctrl |
A list with the settings to control the fleets operating model for each fleet (the fleets' short and long term dynamic models used, price model, additional parameters,...) |
covars.ctrl |
A list with the settings to control the covars operating model for each fleet (a dynamic model for each covariable, additional parameters, ...) |
obs.ctrl |
A list with the settings to control the observation model for each stock (the observation model for the stock, for stock dependent indices, additional parameters, ...) |
assess.ctrl |
A list with the settings to control the specify the assessment model for each stock (the assessment model for the stock and the control parameters used to run the model) |
advice.ctrl |
A list with the settings to control the advice model for each stock (the HCR for each stock, the reference points used in the HCR, additional parameters, ...) |
A list with 8 elements biols, fleets, covars, advice, stocks, indices, fleets.ctrl, pkgs.versions. All the elements except stocks and pkgs.versions correspond with the the updated versions of the objects used in the call to FLBEIA. stocks is a list of FLStocks object containing the perceived stocks used in the management procedure to produce the management advice. pkgs.versions is a matrix indicating the packages and package version used along the simulation.
## Not run: library(FLBEIA) library(FLAssess) # required to use the IcesHCR. Not available for win64 library(FLash) # required to use the IcesHCR. Not available for win64 library(ggplot2) #---------------------------------------------------------------- # Example with 1 stock, 1 Fleets, 1 seasons and 1 iteration: one #---------------------------------------------------------------- # Load the data to run FLBEIA in a one stock one fleet example using the HCR used by ICES # in the MSY framework. data(one) # The names and the class of the objects needed to run FLBEIA. # sapply(ls(), function(x) class(get(x))) # In this scenario a single, age-structured, stock is exploited by a single fleet with a # unique metier. # The fleet catches yearly exactly the adviced TAC and there is no exit-entry of vessels # in the fishery. # The stock abundance and exploitation level is observed without error in the observation # model. # There is no assessment model and the TAC advice is used through the HCR used by ICES # in the MSY framework. s0 <- FLBEIA(biols = oneBio, # FLBiols object with one FLBiol element for stk1. SRs = oneSR, # A list with one FLSRsim object for stk1. BDs = NULL, # No Biomass Dynamic populations in this case. fleets = oneFl, # FLFleets object with on fleet. covars = oneCv, # covars not used indices = NULL, # indices not used advice = oneAdv, # A list with two elements 'TAC' and 'quota.share' main.ctrl = oneMainC, # A list with one element to define the start and end of # the simulation. biols.ctrl = oneBioC, # A list with one element to select the model to simulate # the stock dynamics. fleets.ctrl = oneFlC, # A list with several elements to select fleet dynamic models # and store additional parameters. covars.ctrl = oneCvC, # covars control not used obs.ctrl = oneObsC, # A list with one element to define how the stock observed # ("PerfectObs"). assess.ctrl = oneAssC, # A list with one element to define how the stock assessment # model used ("NoAssessment"). advice.ctrl = oneAdvC) # A list with one element to define how the TAC advice is # obtained ("IcesHCR"). # Names of the object returned by FLBEIA names(s0) # The default plot for FLBiol defined in FLCore plot(s0$biols[[1]]) # Extract reference points for summaries s0_brps <- extractBRP(oneAdvC, stkn = names(oneBio)) # Create summary data frames (biological, economic, and catch) proj.yr <- 2013 s0_sum <- bioSum(s0, brp = s0_brps) s0$fleets$fl1 <- setUnitsNA(s0$fleets$fl1) # set units to NA to avoid errors in fltSum s0_flt <- fltSum(s0) s0_fltStk <- fltStkSum(s0) # Create several plots and save them in the working directory using 'pdf' format and # 's0' suffix in the name. plotFLBiols(s0$biols, pdfnm='s0', ss = 'all') plotFLFleets(s0$fleets, pdfnm='s0', ss = 'all') plotEco(s0, pdfnm='s0') plotfltStkSum(s0, pdfnm='s0') #------------------------------------------------------------ # Example with several iterations: oneIters #------------------------------------------------------------ # Load the same data set as before but with 3 iterations. # Run FLBEIA and plot the results data(oneIt) s1 <- FLBEIA(biols = oneItBio, # FLBiols object with one FLBiol element for stk1. SRs = oneItSR, # A list with one FLSRsim object for stk1. BDs = NULL, # No Biomass Dynamic populations in this case. fleets = oneItFl, # FLFleets object with on fleet. covars = oneItCv, # covars not used indices = NULL, # indices not used advice = oneItAdv, # A list with two elements 'TAC' and 'quota.share' main.ctrl = oneItMainC, # A list with one element to define the start and end of # the simulation. biols.ctrl = oneItBioC, # A list with one element to select the model to simulate # the stock dynamics. fleets.ctrl = oneItFlC, # A list with several elements to select fleet dynamic # models and store additional parameters. covars.ctrl = oneItCvC, # covars control not used obs.ctrl = oneItObsC, # A list with one element to define how the stock observed # ("PerfectObs"). assess.ctrl = oneItAssC, # A list with one element to define how the stock # assessment model used ("NoAssessment"). advice.ctrl = oneItAdvC) # A list with one element to define how the TAC advice is # obtained ("IcesHCR"). # Names of the object returned by FLBEIA names(s1) # The default plot for FLBiol defined in FLCore plot(s1$biols[[1]]) # Extract reference points for summaries s1_brps <- extractBRP(oneItAdvC, stkn = names(oneItBio)) # Create summary data frames (biological, economic, and catch) proj.yr <- 2013 s1_bio <- bioSum(s1, brp = s1_brps) s1$fleets$fl1 <- setUnitsNA(s1$fleets$fl1) # set units to NA to avoid errors in fltSum s1_flt <- fltSum(s1) s1_fltStk <- fltStkSum(s1) s1_bioQ <- bioSumQ(s1_bio) s1_fltQ <- fltSumQ(s1_flt) s1_fltStkQ <- fltStkSumQ(s1_fltStk) s1b_bio <- bioSum(s1, long = FALSE) s1b_flt <- fltSum(s1, long = FALSE) s1b_fltStk <- fltStkSum(s1, long = FALSE) s1b_fltQ <- bioSumQ(s1b_bio) s1b_fltQ <- fltSumQ(s1b_flt) s1b_fltStkQ <- fltStkSumQ(s1b_fltStk) # Create several plots and save them in the working directory using 'pdf' format and # 's1' suffix in the name. plotFLBiols(s1$biols, pdfnm='s1', ss = 'all') plotFLFleets(s1$fleets, pdfnm='s1', ss = 'all') plotEco(s1, pdfnm='s1') plotfltStkSum(s1, pdfnm='s1') #------------------------------------------------------------------ # Example with 2 stock, 2 Fleets, 4 seasons and 1 iteration: multi #------------------------------------------------------------------ # Load the multi data set. This dataset has 2 stocks, one stk1 is # age structured and the second one stk2 is aggregated in biomass. data(multi) # Run FLBEIA. s2 <- FLBEIA(biols = multiBio, # FLBiols object with 2 FLBiol element for stk1. SRs = multiSR, # A list with 1 FLSRsim object for stk1. BDs = multiBD, # A list with 1 FLBDSim object for stk2. fleets = multiFl, # FLFleets object with on fleet. covars = multiCv, # covars not used indices = NULL, # indices not used advice = multiAdv, # A list with two elements 'TAC' and 'quota.share' main.ctrl = multiMainC, # A list with one element to define the start and end # of the simulation. biols.ctrl = multiBioC, # A list with one element to select the model to simulate # the stock dynamics. fleets.ctrl = multiFlC, # A list with several elements to select fleet dynamic # models and store additional parameters. covars.ctrl = multiCvC, # covars control not used obs.ctrl = multiObsC, # A list with one element to define how the stock observed # ("PerfectObs"). assess.ctrl = multiAssC, # A list with one element to define how the stock # assessment model used ("NoAssessment"). advice.ctrl = multiAdvC) # A list with one element to define how the TAC advice is # obtained ("IcesHCR"). # Names of the object returned by FLBEIA names(s2) # The default plot for FLBiol defined in FLCore plot(s2$biols[[1]]) # Extract reference points for summaries s2_brps <- extractBRP(multiAdvC, stkn = names(multiBio)) # Create summary data frames (biological, economic, and catch) s2_sum <- bioSum(s2, brp = s2_brps) for (fl in names(s2$fleets)) # set units to NA to avoid errors in fltSum s2$fleets[[fl]] <- setUnitsNA(s2$fleets[[fl]]) s2_flt <- fltSum(s2) s2b_flt <- fltSum(s2, byyear = FALSE) s2_fltStk <- fltStkSum(s2) # Create several plots and save them in the working directory using 'pdf' format and # 's2' suffix in the name. plotFLBiols(s2$biols, pdfnm='s2', ss = 2) plotFLFleets(s2$fleets, pdfnm='s2', ss = 2) plotEco(s2, pdfnm='s2') plotfltStkSum(s2, pdfnm='s2') ## End(Not run)
## Not run: library(FLBEIA) library(FLAssess) # required to use the IcesHCR. Not available for win64 library(FLash) # required to use the IcesHCR. Not available for win64 library(ggplot2) #---------------------------------------------------------------- # Example with 1 stock, 1 Fleets, 1 seasons and 1 iteration: one #---------------------------------------------------------------- # Load the data to run FLBEIA in a one stock one fleet example using the HCR used by ICES # in the MSY framework. data(one) # The names and the class of the objects needed to run FLBEIA. # sapply(ls(), function(x) class(get(x))) # In this scenario a single, age-structured, stock is exploited by a single fleet with a # unique metier. # The fleet catches yearly exactly the adviced TAC and there is no exit-entry of vessels # in the fishery. # The stock abundance and exploitation level is observed without error in the observation # model. # There is no assessment model and the TAC advice is used through the HCR used by ICES # in the MSY framework. s0 <- FLBEIA(biols = oneBio, # FLBiols object with one FLBiol element for stk1. SRs = oneSR, # A list with one FLSRsim object for stk1. BDs = NULL, # No Biomass Dynamic populations in this case. fleets = oneFl, # FLFleets object with on fleet. covars = oneCv, # covars not used indices = NULL, # indices not used advice = oneAdv, # A list with two elements 'TAC' and 'quota.share' main.ctrl = oneMainC, # A list with one element to define the start and end of # the simulation. biols.ctrl = oneBioC, # A list with one element to select the model to simulate # the stock dynamics. fleets.ctrl = oneFlC, # A list with several elements to select fleet dynamic models # and store additional parameters. covars.ctrl = oneCvC, # covars control not used obs.ctrl = oneObsC, # A list with one element to define how the stock observed # ("PerfectObs"). assess.ctrl = oneAssC, # A list with one element to define how the stock assessment # model used ("NoAssessment"). advice.ctrl = oneAdvC) # A list with one element to define how the TAC advice is # obtained ("IcesHCR"). # Names of the object returned by FLBEIA names(s0) # The default plot for FLBiol defined in FLCore plot(s0$biols[[1]]) # Extract reference points for summaries s0_brps <- extractBRP(oneAdvC, stkn = names(oneBio)) # Create summary data frames (biological, economic, and catch) proj.yr <- 2013 s0_sum <- bioSum(s0, brp = s0_brps) s0$fleets$fl1 <- setUnitsNA(s0$fleets$fl1) # set units to NA to avoid errors in fltSum s0_flt <- fltSum(s0) s0_fltStk <- fltStkSum(s0) # Create several plots and save them in the working directory using 'pdf' format and # 's0' suffix in the name. plotFLBiols(s0$biols, pdfnm='s0', ss = 'all') plotFLFleets(s0$fleets, pdfnm='s0', ss = 'all') plotEco(s0, pdfnm='s0') plotfltStkSum(s0, pdfnm='s0') #------------------------------------------------------------ # Example with several iterations: oneIters #------------------------------------------------------------ # Load the same data set as before but with 3 iterations. # Run FLBEIA and plot the results data(oneIt) s1 <- FLBEIA(biols = oneItBio, # FLBiols object with one FLBiol element for stk1. SRs = oneItSR, # A list with one FLSRsim object for stk1. BDs = NULL, # No Biomass Dynamic populations in this case. fleets = oneItFl, # FLFleets object with on fleet. covars = oneItCv, # covars not used indices = NULL, # indices not used advice = oneItAdv, # A list with two elements 'TAC' and 'quota.share' main.ctrl = oneItMainC, # A list with one element to define the start and end of # the simulation. biols.ctrl = oneItBioC, # A list with one element to select the model to simulate # the stock dynamics. fleets.ctrl = oneItFlC, # A list with several elements to select fleet dynamic # models and store additional parameters. covars.ctrl = oneItCvC, # covars control not used obs.ctrl = oneItObsC, # A list with one element to define how the stock observed # ("PerfectObs"). assess.ctrl = oneItAssC, # A list with one element to define how the stock # assessment model used ("NoAssessment"). advice.ctrl = oneItAdvC) # A list with one element to define how the TAC advice is # obtained ("IcesHCR"). # Names of the object returned by FLBEIA names(s1) # The default plot for FLBiol defined in FLCore plot(s1$biols[[1]]) # Extract reference points for summaries s1_brps <- extractBRP(oneItAdvC, stkn = names(oneItBio)) # Create summary data frames (biological, economic, and catch) proj.yr <- 2013 s1_bio <- bioSum(s1, brp = s1_brps) s1$fleets$fl1 <- setUnitsNA(s1$fleets$fl1) # set units to NA to avoid errors in fltSum s1_flt <- fltSum(s1) s1_fltStk <- fltStkSum(s1) s1_bioQ <- bioSumQ(s1_bio) s1_fltQ <- fltSumQ(s1_flt) s1_fltStkQ <- fltStkSumQ(s1_fltStk) s1b_bio <- bioSum(s1, long = FALSE) s1b_flt <- fltSum(s1, long = FALSE) s1b_fltStk <- fltStkSum(s1, long = FALSE) s1b_fltQ <- bioSumQ(s1b_bio) s1b_fltQ <- fltSumQ(s1b_flt) s1b_fltStkQ <- fltStkSumQ(s1b_fltStk) # Create several plots and save them in the working directory using 'pdf' format and # 's1' suffix in the name. plotFLBiols(s1$biols, pdfnm='s1', ss = 'all') plotFLFleets(s1$fleets, pdfnm='s1', ss = 'all') plotEco(s1, pdfnm='s1') plotfltStkSum(s1, pdfnm='s1') #------------------------------------------------------------------ # Example with 2 stock, 2 Fleets, 4 seasons and 1 iteration: multi #------------------------------------------------------------------ # Load the multi data set. This dataset has 2 stocks, one stk1 is # age structured and the second one stk2 is aggregated in biomass. data(multi) # Run FLBEIA. s2 <- FLBEIA(biols = multiBio, # FLBiols object with 2 FLBiol element for stk1. SRs = multiSR, # A list with 1 FLSRsim object for stk1. BDs = multiBD, # A list with 1 FLBDSim object for stk2. fleets = multiFl, # FLFleets object with on fleet. covars = multiCv, # covars not used indices = NULL, # indices not used advice = multiAdv, # A list with two elements 'TAC' and 'quota.share' main.ctrl = multiMainC, # A list with one element to define the start and end # of the simulation. biols.ctrl = multiBioC, # A list with one element to select the model to simulate # the stock dynamics. fleets.ctrl = multiFlC, # A list with several elements to select fleet dynamic # models and store additional parameters. covars.ctrl = multiCvC, # covars control not used obs.ctrl = multiObsC, # A list with one element to define how the stock observed # ("PerfectObs"). assess.ctrl = multiAssC, # A list with one element to define how the stock # assessment model used ("NoAssessment"). advice.ctrl = multiAdvC) # A list with one element to define how the TAC advice is # obtained ("IcesHCR"). # Names of the object returned by FLBEIA names(s2) # The default plot for FLBiol defined in FLCore plot(s2$biols[[1]]) # Extract reference points for summaries s2_brps <- extractBRP(multiAdvC, stkn = names(multiBio)) # Create summary data frames (biological, economic, and catch) s2_sum <- bioSum(s2, brp = s2_brps) for (fl in names(s2$fleets)) # set units to NA to avoid errors in fltSum s2$fleets[[fl]] <- setUnitsNA(s2$fleets[[fl]]) s2_flt <- fltSum(s2) s2b_flt <- fltSum(s2, byyear = FALSE) s2_fltStk <- fltStkSum(s2) # Create several plots and save them in the working directory using 'pdf' format and # 's2' suffix in the name. plotFLBiols(s2$biols, pdfnm='s2', ss = 2) plotFLFleets(s2$fleets, pdfnm='s2', ss = 2) plotEco(s2, pdfnm='s2') plotfltStkSum(s2, pdfnm='s2') ## End(Not run)
A list of FLCatchExt
objects.
vFLCs(object) ## S4 method for signature 'ANY' FLCatchesExt(object, ...) ## S4 method for signature 'missing' FLCatchesExt(object, ...) ## S4 method for signature 'list' FLCatchesExt(object) is.FLCatchesExt(object, ...) ## S4 method for signature 'ANY' is.FLCatchesExt(object, ...) ## S4 method for signature 'FLCatchesExt' catchNames(object) ## S4 method for signature 'FLMetierExt' catchNames(object) ## S4 method for signature 'FLMetiersExt' catchNames(object) ## S4 method for signature 'FLFleetExt' catchNames(object) ## S4 method for signature 'FLFleetsExt' catchNames(object)
vFLCs(object) ## S4 method for signature 'ANY' FLCatchesExt(object, ...) ## S4 method for signature 'missing' FLCatchesExt(object, ...) ## S4 method for signature 'list' FLCatchesExt(object) is.FLCatchesExt(object, ...) ## S4 method for signature 'ANY' is.FLCatchesExt(object, ...) ## S4 method for signature 'FLCatchesExt' catchNames(object) ## S4 method for signature 'FLMetierExt' catchNames(object) ## S4 method for signature 'FLMetiersExt' catchNames(object) ## S4 method for signature 'FLFleetExt' catchNames(object) ## S4 method for signature 'FLFleetsExt' catchNames(object)
object |
An object of class FLCatchExt, list or missing. |
... |
Other objects to be assigned by name to the class slots. |
Internal S4 data representation, of class list
.
As textual description of the object contents
Can the object be extended/trimmed? TRUE
or FALSE
.
A character vector for the element names
The FLBEIA Team
FLlst
, list
,
vector
, FLCatchExt
It extends the FLCatch class defined in FLFleet package. The FLCatch class includes two extra slots alpha and beta used in the Cobb-Douglas production functions.
## S4 method for signature 'FLQuant' FLCatchExt(object, range = "missing", name = "NA", desc = character(0), ...) ## S4 method for signature 'missing' FLCatchExt(object, ...) ## S4 method for signature 'FLCatchExt,ANY,ANY,ANY' x[i, j, k, l, m, n, ..., drop = FALSE] ## S4 replacement method for signature 'FLCatchExt,ANY,ANY,FLCatchExt' x[i, j, k, l, m, n, ...] <- value catchNames(object, ...) <- value ## S4 method for signature 'FLCatchExt,FLCatchExt' addFLCatch(e1, e2) ## S4 method for signature 'FLCatchExt' catchNames(object) ## S4 replacement method for signature 'FLCatchExt,character' catchNames(object) <- value
## S4 method for signature 'FLQuant' FLCatchExt(object, range = "missing", name = "NA", desc = character(0), ...) ## S4 method for signature 'missing' FLCatchExt(object, ...) ## S4 method for signature 'FLCatchExt,ANY,ANY,ANY' x[i, j, k, l, m, n, ..., drop = FALSE] ## S4 replacement method for signature 'FLCatchExt,ANY,ANY,FLCatchExt' x[i, j, k, l, m, n, ...] <- value catchNames(object, ...) <- value ## S4 method for signature 'FLCatchExt,FLCatchExt' addFLCatch(e1, e2) ## S4 method for signature 'FLCatchExt' catchNames(object) ## S4 replacement method for signature 'FLCatchExt,character' catchNames(object) <- value
object , x
|
An object of class FLQuant, missing or FLCatchExt. |
range |
Numerical vector with min, max, plusgroup, minyear and maxyear elements as in FLStock object. |
name |
The name of the stock. |
desc |
The description of the object. |
... |
Other objects to be assigned by name to the class slots. |
i , j , k , l , m , n
|
subindices |
drop |
logical. Should the dimesions be dropped? |
value |
Value or values to be assigned to the particular FLQuant or FLCatchExt slot. |
e1 , e2
|
FLCatchExt objects, where e2 is incorporated into e1 (see addFLCatch). |
The FLCatchExt object contains a representation of the catch of a fish stock as constructed for the purposes of fleet dynamic modelling. This includes information on removals (i.e. landings and discards), selectivity, weight, price and catch production parameters (catchability and elasticities).
The constructors return an object of class FLCatchExt.
landings
An FLQuant with the total landings in weight of the stock.
landings.n
An FLQuant with the landings in numbers at age of the stock.
landings.wt
An FLQuant with the weight at age of the landings.
discards
An FLQuant with the total discards in weight of the stock.
discards.n
An FLQuant with the discards in numbers at age of the stock.
discards.wt
An FLQuant with the weight at age of the discards.
landings.sel,discards.sel
An FLQuant with the landing/discard ogive of the metier for this stock (i.e. landings.sel corresponds to the proportion of catches landed). Elements must be between 0 and 1, with discards.sel = 1-landings.sel.
catch.q
An FLQuant with the catchability at age of the stock for the corresponding metier. This is the catchability used in the catch production model.
price
An FLQuant with the price at age of the stock.
alpha
An FLQuant with the elasticity parameter at age of the stock for the corresponding metier. This is one of the parameters used in the catch production model.
beta
An FLQuant with the elasticity parameter at age of the stock for the corresponding metier. This is one of the parameters used in the catch production model.
name
The name of the stock.
desc
A description of the object.
range
The range as in other FLR objects: c("min","max","plusgroup","minyear","maxyear").
It extends the FLFleetExt class defined in FLFleet package. The only difference is that that the metiers slot is a FLMetiersExt object.
## S4 method for signature 'FLMetiersExt' FLFleetExt(object, ...) ## S4 method for signature 'FLMetierExt' FLFleetExt(object, ...) ## S4 method for signature 'FLCatchesExt' FLFleetExt(object, ...) ## S4 method for signature 'FLCatchExt' FLFleetExt(object, ...) ## S4 method for signature 'FLFleetExt' FLFleetExt(object, metier, catch, ...) ## S4 method for signature 'missing' FLFleetExt(object, ...) ## S4 method for signature 'FLFleetExt,ANY,missing,ANY' x[i, drop = FALSE] ## S4 method for signature 'FLFleetExt,ANY,ANY,ANY' x[i, j, drop = FALSE] ## S4 method for signature 'FLFleetExt,ANY,missing' x[[i, drop = FALSE]]
## S4 method for signature 'FLMetiersExt' FLFleetExt(object, ...) ## S4 method for signature 'FLMetierExt' FLFleetExt(object, ...) ## S4 method for signature 'FLCatchesExt' FLFleetExt(object, ...) ## S4 method for signature 'FLCatchExt' FLFleetExt(object, ...) ## S4 method for signature 'FLFleetExt' FLFleetExt(object, metier, catch, ...) ## S4 method for signature 'missing' FLFleetExt(object, ...) ## S4 method for signature 'FLFleetExt,ANY,missing,ANY' x[i, drop = FALSE] ## S4 method for signature 'FLFleetExt,ANY,ANY,ANY' x[i, j, drop = FALSE] ## S4 method for signature 'FLFleetExt,ANY,missing' x[[i, drop = FALSE]]
object , x
|
An object of class FLQuant, missing, FLFleetExt, FLCatchExt, FLCatchesExt or FLMetierExt. |
... |
Other objects to be assigned by name to the class slots |
metier |
A name of one of the elements in FLMetiersExt object. |
catch |
A name of one of the elements in FLCatchesExt object. |
i , j
|
subindices. |
drop |
If TRUE, deletes the dimensions of an array which have only one level. |
The FLFleetExt object contains a representation of a fishing fleet as constructed for the purposes of fleet dynamic modelling. This includes information on effort, fixed-cost, capacity, crew-share, metiers and variable costs.
The constructors return an object of class FLFleetExt.
effort
An FLQuant with the effort of the fleet. The effort can have any units (e.g. number of fishing days, trips, hooks,...)
fcost
An FLQuant with the fixed costs of the fleet. These costs should be given by vessel and the number of vessels by fleet must be included in the covars object.
capacity
An FLQuant with the capacity of the fleet. Same units as in slot effort must be used.
crewshare
An FLQuant with the crewshare of the fleet. Where crewshare is the percentage of revenues that goes to the crew.
metiers
A FLMetiersExt with information on the fleet's metiers.
name
The name of the stock.
desc
A description of the object.
range
The range as in other FLR objects: c("min","max","plusgroup","minyear","maxyear").
A list of FLFleetExt
objects.
vFLFs(object) ## S4 method for signature 'ANY' FLFleetsExt(object, ...) ## S4 method for signature 'missing' FLFleetsExt(object, ...) ## S4 method for signature 'list' FLFleetsExt(object) is.FLFleetsExt(object, ...) ## S4 method for signature 'ANY' is.FLFleetsExt(object, ...)
vFLFs(object) ## S4 method for signature 'ANY' FLFleetsExt(object, ...) ## S4 method for signature 'missing' FLFleetsExt(object, ...) ## S4 method for signature 'list' FLFleetsExt(object) is.FLFleetsExt(object, ...) ## S4 method for signature 'ANY' is.FLFleetsExt(object, ...)
object |
An object of class FLFleetExt, list or missing. |
... |
Other objects to be assigned by name to the class slots. |
Internal S4 data representation, of class list
.
As textual description of the object contents
Can the object be extended/trimmed? TRUE
or FALSE
.
A character vector for the element names
The FLBEIA Team
FLlst
, list
,
vector
, FLFleetExt
It extends the FLMetier class defined in FLFleet package. The only difference is that that the catches slot is a FLCatchesExt object.
## S4 method for signature 'FLCatchExt' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'FLCatchesExt' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'FLQuant' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'missing' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'FLMetierExt,ANY,missing,ANY' x[i, drop = FALSE] ## S4 method for signature 'FLMetierExt,ANY,missing' x[[i, drop = FALSE]]
## S4 method for signature 'FLCatchExt' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'FLCatchesExt' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'FLQuant' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'missing' FLMetierExt(catches, gear = "NA", ...) ## S4 method for signature 'FLMetierExt,ANY,missing,ANY' x[i, drop = FALSE] ## S4 method for signature 'FLMetierExt,ANY,missing' x[[i, drop = FALSE]]
catches , x
|
An object of class FLQuant, missing or FLCatchExt. |
gear |
A character vector with the name of the gear used in the metier. |
... |
Other objects to be assigned by name to the class slots |
i |
subindices. |
drop |
If TRUE, deletes the dimensions of an array which have only one level. |
The FLMetierExt object contains a representation of the metier of a fishing fleet as constructed for the purposes of fleet dynamic modelling. This includes information on effortshare and variable costs.
The constructors return an object of class FLMetierExt.
gear
A character with the gear name of a fleet's metier.
effshare
An FLQuant with the effort share of a fleet's metier relative to fleet's total effort (the sum of all metiers effshares for a fleet must sum 1).
vcost
An FLQuant with the varible costs of a fleet's metier. These costs should be given by vessel and based on the effort units used for the fleet's effort (within the FLFleetExt object). The number of vessels by fleet must be included in the covars object.
catches
A FLCatchesExt with information on the fleet's metier catches.
name
The name of the stock.
desc
A description of the object.
range
The range as in other FLR objects: c("min","max","plusgroup","minyear","maxyear").
A list of FLMetierExt
objects.
vFLMs(object) ## S4 method for signature 'ANY' FLMetiersExt(object, ...) ## S4 method for signature 'missing' FLMetiersExt(object, ...) ## S4 method for signature 'list' FLMetiersExt(object) is.FLMetiersExt(object, ...) ## S4 method for signature 'ANY' is.FLMetiersExt(object, ...)
vFLMs(object) ## S4 method for signature 'ANY' FLMetiersExt(object, ...) ## S4 method for signature 'missing' FLMetiersExt(object, ...) ## S4 method for signature 'list' FLMetiersExt(object) is.FLMetiersExt(object, ...) ## S4 method for signature 'ANY' is.FLMetiersExt(object, ...)
object |
An object of class FLMetierExt, list or missing. |
... |
Other objects to be assigned by name to the class slots. |
Internal S4 data representation, of class list
.
As textual description of the object contents
Can the object be extended/trimmed? TRUE
or FALSE
.
A character vector for the element names
The FLBEIA Team
FLlst
, list
,
vector
, FLMetierExt
This class is used to store the necessary information to simulate the recruitment process within FLBEIA.
... |
Any of the slots in FLSRsim class. |
The FLSRsim class contains a representation of the recruitment process of a fish stock. This includes information on recruitment, ssb, recruitment model, uncertainty and distribution of the recruitment along seasons. The slots in this class:
An object of class FLSRsim.
rec
An FLQuant with to store the recruitment.
ssb
An FLQuant with to store the ssb.
covar
An FLQuants to store the covariates considered in the stock-recruitment model, one FQuant per covariate.
uncertainty
An FLQuant with to store the uncertainty that is multiplied to the recruitment point estimate in each step of the simulation.
proportion
An FLQuant with values between 0 and 1 to indicate how the recruitment in each of the time steps is distributed along season.
model
A character with the name of the model to simulate the recruitment process.
params
An array with dimensions [number of params,number of years,number of seasons,number of iteration].
timelag
A matrix [2, number of seasons]. The element (1,j) indicates the time lag between the spawning and recruitment year and the element (2,j) the season in which the recruitment was spawn.
name
A character with the name of the stock.
desc
A description of the object.
range
A numeric vector with c(min, max,plusgroup, minyear, maxyear) as in the rest of the FLR objects.
joinIter function allows to join different outputs of FBEIA simulations. For example when simulations are run iteration by iteration separately, with this function we can merged all the iterations into one FLBEIA output object.
joinIter( objnam, files, directory = NULL, Niters = 1, elements = "all", advice.ext = "TAC", fleets.ctrl.ext = "seasonal.share" )
joinIter( objnam, files, directory = NULL, Niters = 1, elements = "all", advice.ext = "TAC", fleets.ctrl.ext = "seasonal.share" )
objnam |
Character. The name of the object that will be joined. The object must be the output of FLBEIA function. |
files |
A character vector with the names of the files from which |
directory |
The directory were the files are stored. Default value is the current directory. |
Niters |
A numeric vector with the number of iterations per object. If length=1, then it is assumed that all objects have the same number of iterations. |
elements |
The elements of the objects that must be joined. The default is to join all the objects. |
advice.ext |
Character. The element from |
fleets.ctrl.ext |
Character. The element from |
A new FLBEIA output object with all the iterations joined.
The files must contain a single object (named as objnam
value).
Summarize the results in a plot.
plotbioSum(obj, stk.nam, Blim = NA, Bpa = NA, proj.yr = NA) plotfltSum(obj, flt.nam, proj.yr = NA)
plotbioSum(obj, stk.nam, Blim = NA, Bpa = NA, proj.yr = NA) plotfltSum(obj, flt.nam, proj.yr = NA)
obj |
An object with the same format as bioSum and fltSum outputs, respectively. |
stk.nam |
Character with the name of the stock for which summary information will be plotted. If not defined, then the first one in obj will be selected by default. |
Blim |
Numeric. Blim reference point for the stock (optional argument).=NA, Bpa=NA, proj.yr=NA) |
Bpa |
Numeric. Bpa reference point for the stock (optional argument). |
proj.yr |
Numeric. Year in which projection period starts (optional argument). |
flt.nam |
Character with the name of the fleet for which summary information will be plotted. If not defined, then the first one in obj will be selected by default. |
plotbioSum: Plot summarising information on stock. With one plot for each of the following indicators: "catch", "rec", "f" and "ssb". Input object should have the same format as the output of bioSum function.
plotfltSum: Plot summarising information on fleet's economic indicators. With one plot for each of the following indicators: "catch", "effort", "grossValue" and "grossSurplus". Input object should have the same format as the output of fltSum function.
Plot.
## Not run: library(FLBEIA) # Apply the summary plots to the examples runs in FLBEIA help page. data(res_flbeia) #------------------------------------------------ # Example One: One stock, one fleet, one iter. #------------------------------------------------ # Biological indicators. plotbioSum( bioSum(oneRes), Blim=800, Bpa=1200, proj.yr=2010) # bioSum output in wide format plotbioSum( bioSum(oneRes, long = FALSE)) # bioSum output in long format plotbioSum( bioSum(oneRes), stk.nam='stk0') # if incorrect name for the stock # Indicators at fleet level. plotfltSum( fltSum(oneRes), proj.yr=2010) # fltSum output in wide format plotfltSum( fltSum(oneRes, long = FALSE)) # fltSum output in long format plotfltSum( fltSum(oneRes), flt.nam='stk1') # if incorrect name for the fleet plotfltSum( fltSum(oneRes, byyear = FALSE)) # although seasonal disagregation, # it is summarised by year #------------------------------------------------ # Example OneIters: As one but with iterations. #------------------------------------------------ # Biological indicators. plotbioSum( bioSum(s1), Blim=800, Bpa=1200, proj.yr=2010) # bioSum output in wide format plotbioSum( bioSum(s1, long = FALSE)) # bioSum output in long format plotbioSum( bioSum(s1), stk.nam='stk0') # if incorrect name for the stock # Indicators at fleet level. plotfltSum( fltSum(s1), proj.yr=2010) # fltSum output in wide format plotfltSum( fltSum(s1, long = FALSE)) # fltSum output in long format plotfltSum( fltSum(s1), flt.nam='stk1') # if incorrect name for the fleet plotfltSum( fltSum(s1, byyear = FALSE)) # although seasonal disagregation, # it is summarised by year # also possible to plot information on various scenarios sc11_bio <- bioSum(s1) sc12_bio <- bioSum(s1, scenario='alt'); sc12_bio$value <- sc12_bio$value*1.05 plotbioSum(rbind(sc11_bio, sc12_bio), Blim=800, Bpa=1200, proj.yr=2010) #------------------------------------------------ # Example Multi: Two stock, two fleet, four iters. #------------------------------------------------ for (st in names(s2$stocks)) # one plot for each stock plotbioSum( bioSum(s2, scenario='s2'), stk.nam=st, proj.yr=2010) for (fl in names(s2$fleets)) # one plot for each fleet plotfltSum( fltSum(s2, scenario='s2'), flt.nam=fl, proj.yr=2010) ## End(Not run)
## Not run: library(FLBEIA) # Apply the summary plots to the examples runs in FLBEIA help page. data(res_flbeia) #------------------------------------------------ # Example One: One stock, one fleet, one iter. #------------------------------------------------ # Biological indicators. plotbioSum( bioSum(oneRes), Blim=800, Bpa=1200, proj.yr=2010) # bioSum output in wide format plotbioSum( bioSum(oneRes, long = FALSE)) # bioSum output in long format plotbioSum( bioSum(oneRes), stk.nam='stk0') # if incorrect name for the stock # Indicators at fleet level. plotfltSum( fltSum(oneRes), proj.yr=2010) # fltSum output in wide format plotfltSum( fltSum(oneRes, long = FALSE)) # fltSum output in long format plotfltSum( fltSum(oneRes), flt.nam='stk1') # if incorrect name for the fleet plotfltSum( fltSum(oneRes, byyear = FALSE)) # although seasonal disagregation, # it is summarised by year #------------------------------------------------ # Example OneIters: As one but with iterations. #------------------------------------------------ # Biological indicators. plotbioSum( bioSum(s1), Blim=800, Bpa=1200, proj.yr=2010) # bioSum output in wide format plotbioSum( bioSum(s1, long = FALSE)) # bioSum output in long format plotbioSum( bioSum(s1), stk.nam='stk0') # if incorrect name for the stock # Indicators at fleet level. plotfltSum( fltSum(s1), proj.yr=2010) # fltSum output in wide format plotfltSum( fltSum(s1, long = FALSE)) # fltSum output in long format plotfltSum( fltSum(s1), flt.nam='stk1') # if incorrect name for the fleet plotfltSum( fltSum(s1, byyear = FALSE)) # although seasonal disagregation, # it is summarised by year # also possible to plot information on various scenarios sc11_bio <- bioSum(s1) sc12_bio <- bioSum(s1, scenario='alt'); sc12_bio$value <- sc12_bio$value*1.05 plotbioSum(rbind(sc11_bio, sc12_bio), Blim=800, Bpa=1200, proj.yr=2010) #------------------------------------------------ # Example Multi: Two stock, two fleet, four iters. #------------------------------------------------ for (st in names(s2$stocks)) # one plot for each stock plotbioSum( bioSum(s2, scenario='s2'), stk.nam=st, proj.yr=2010) for (fl in names(s2$fleets)) # one plot for each fleet plotfltSum( fltSum(s2, scenario='s2'), flt.nam=fl, proj.yr=2010) ## End(Not run)
Function for generating YPR plots for reference points when having a seasonal model
plotBRPsson(obj, pdfnm = "Fbar_vs_SPR.pdf")
plotBRPsson(obj, pdfnm = "Fbar_vs_SPR.pdf")
obj |
The output of brpsson function or a data.frame with the same structure as the runs object in the output list of brpsson function. |
pdfnm |
The name of the pdf document where plots are going to be saved. |
A pdf for each stock with plots.
Return a pdf with plots using FLBEIA object (FLFleets and covars).
plotEco(obj, probs = c(0.95, 0.5, 0.05), pdfnm = "bc")
plotEco(obj, probs = c(0.95, 0.5, 0.05), pdfnm = "bc")
obj |
An FLBEIA object. |
probs |
A numeric vector with the probabilities used to calculate the quantiles. |
pdfnm |
The name for the pdf document will be "Eco" and pdfnm separated by a line. |
A pdf with capacity, costs, effort, profits by fleet.
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotEco(oneRes, pdfnm='one') ## End(Not run)
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotEco(oneRes, pdfnm='one') ## End(Not run)
For each stock, return a pdf with plots using FLBiols object.
plotFLBiols(biols, probs = c(0.95, 0.5, 0.05), pdfnm = "bc", u = 1, ss = 1)
plotFLBiols(biols, probs = c(0.95, 0.5, 0.05), pdfnm = "bc", u = 1, ss = 1)
biols |
A FLBiols object |
probs |
a numeric vector with the probabilities used to calculate the quantiles. |
pdfnm |
The name for the pdf document will be stock's name and pdfnm separated by a line. |
Each pdf contains biomass in numbers at age, mean weight at age, fecundity, natural mortality, maturity, spawning, recruitment and spawning stock biomass
A pdf for each stock with plots.
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotFLBiols(oneRes$biols, pdfnm='oneRes') ## End(Not run)
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotFLBiols(oneRes$biols, pdfnm='oneRes') ## End(Not run)
For each fleet, return a pdf with plots using FLFleets object.
plotFLFleets(fleets, probs = c(0.95, 0.5, 0.05), pdfnm = "bc", u = 1, ss = 1)
plotFLFleets(fleets, probs = c(0.95, 0.5, 0.05), pdfnm = "bc", u = 1, ss = 1)
fleets |
A FLFleets object. |
probs |
A numeric vector with the probabilities used to calculate the quantiles. |
pdfnm |
The name for the pdf document will be the fleet's name and pdfnm separated by a line. |
For each fleet, the pdf contains plots of:
Catch, discards, landings, capacity, crewshare, effort, fcost, effshare
For each metier: landings and discards at age in numbers and mean weight, alpha, beta and catch.q
A pdf for each fleet with plots.
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotFLFleets(oneRes$fleets,pdfnm='oneFl') ## End(Not run)
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotFLFleets(oneRes$fleets,pdfnm='oneFl') ## End(Not run)
Return a pdf with plots with the outputs fltStkSum, usint the output of FLBEIA.
plotfltStkSum(obj, pdfnm)
plotfltStkSum(obj, pdfnm)
obj |
FLBEIA output |
pdfnm |
The name for the pdf document will be 'fltStkSum-' and pdfnm. |
One pdf with plots on landings, discards,catch,price,quotaUpt,tacshare,discRat,quota by fleet and stock.
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotfltStkSum(obj=oneRes,pdfnm = "oneRes") ## End(Not run)
## Not run: library(FLBEIA) library(ggplot2) data(res_flbeia) plotfltStkSum(obj=oneRes,pdfnm = "oneRes") ## End(Not run)
These functions provide summary results of costs, prices and revenues. Provided data can be dessagregated by fleet or by metier depending on the selected function.
revenue_flbeia(fleet) costs_flbeia(fleet, covars, flnm = NULL) totvcost_flbeia(fleet) totfcost_flbeia(fleet, covars, flnm = NULL) price_flbeia(fleet, stock)
revenue_flbeia(fleet) costs_flbeia(fleet, covars, flnm = NULL) totvcost_flbeia(fleet) totfcost_flbeia(fleet, covars, flnm = NULL) price_flbeia(fleet, stock)
fleet |
An element of FLfleets object. |
covars |
List of FLQuants with information on covariates. |
flnm |
Names of the fleets. |
stock |
An FLStock object. |
revenue_flbeia computes the revenue by fleet and metier. The revenue is computed as landings (weight) multiplied by the price.
costs_flbeia computes total costs as the sum of fixed and variable costs.
totvcost_flbeia computes the variable costs including crew share costs .
totfcost_flbeia computes the total costs by vessel.
price_flbeia computes the price by stock.
Model formulation:
segregmix()
segregmix()
R = ifelse(S <= b, a*S, ifelse(S <= B, a*b, A*B*uncAdd))
a is the slope of the recruitment for stock levels at or below b,
is the mean recruitment for stock levels above b and at or below B, and
is the mean recruitment for stock levels above B.
Where a, b, A, B > 0.
Additional stock-recruitment (SR) models to the ones provided in FLCore package.
The FLBEIA Team
Estimates selectivity at age of an stock by a fleet and metier.
SelAtAge( biols, fleets, flnm = 1, mtnm = 1, stnm = 1, years, iter = NULL, restriction = 1, ntrials = 3 )
SelAtAge( biols, fleets, flnm = 1, mtnm = 1, stnm = 1, years, iter = NULL, restriction = 1, ntrials = 3 )
biols |
A FLBiols object. |
fleets |
A FLFleetsExt object. |
flnm |
A character vector with the name of the fleet for which you want to calculate selectivity. |
mtnm |
A character vector with the name of the metier for which you want to calculate selectivity. |
stnm |
A character vector with the name of the stock for which you want to calculate selectivity. |
years |
A character vector with the name of the years used to calculate selectivity. |
iter |
Numeric vector with the specific iterations to be consider. Default is taking all iterations. |
restriction |
If restriction = 1 => sum(Sa) = 1, whereas if restriction = 2 => max(Sa) = 1. Default value is 1. |
ntrials |
Numeric. If ntrials > 1, process success is checked. |
To calculate selectivity at age, the following formula is used:
Where:
a: age.
f: fleet.
m: metier.
i: susbscript of age.
: selectivity at age 'a' for fleet 'f' and metier 'm'.
: catch (in weight) at age 'a' for fleet 'f' and metier 'm'.
: total catch for fleet 'f' and metier 'm'.
: biomass (in weight) at age.
Consult FLBEIA manual to see the derivation of the formula.
The equation above is nonlinear and therefore we cannot find an analytical expression for the selectivity. Rewriting the equation above for each 'a' we have de following equation:
Thus we have a system of linear equations being Sa0fm,...,Sa+fm the unknown variables. The problem is that the equations in the system are not independent. Therefore, we have to remove one equation to get a system of independent equations. Furthermore, we have to add a constraint (an equation) to be able to solve the system.
To make sure that output is correct, we solve the sistem for each year and season several times
(the number is set in ntrials
), removing a different equation each time.
Alway using the same constraint (restriction=1
):
Finally, we compare the values of
and we check if they are the same.
A FLQuant with selectivity at age values in years
.
The rest of the years have value 0 for all ages.
Function to remove the units from the FLQuants of an object
setUnitsNA(object) ## S4 method for signature 'FLBiol' setUnitsNA(object) ## S4 method for signature 'FLBiols' setUnitsNA(object) ## S4 method for signature 'FLFleetExt' setUnitsNA(object) ## S4 method for signature 'FLFleetsExt' setUnitsNA(object)
setUnitsNA(object) ## S4 method for signature 'FLBiol' setUnitsNA(object) ## S4 method for signature 'FLBiols' setUnitsNA(object) ## S4 method for signature 'FLFleetExt' setUnitsNA(object) ## S4 method for signature 'FLFleetsExt' setUnitsNA(object)
object |
An object of class FLBiol, FLBiols, FLFleetExt or FLFleetsExt object. |
The same object with the units equal to NA in all the FLQuant slots.
data(one) st <- setUnitsNA(oneBio) fl <- setUnitsNA(oneFl) data(multi) biols <- setUnitsNA(multiBio) fleets <- setUnitsNA(multiFl) data(res_flbeia) res_biols <- setUnitsNA(multiRes$biols) res_fleets <- setUnitsNA(multiRes$fleets)
data(one) st <- setUnitsNA(oneBio) fl <- setUnitsNA(oneFl) data(multi) biols <- setUnitsNA(multiBio) fleets <- setUnitsNA(multiFl) data(res_flbeia) res_biols <- setUnitsNA(multiRes$biols) res_fleets <- setUnitsNA(multiRes$fleets)
Indicates which stocks are caugth by each fleet-metier combination.
stock.fleetInfo(fleets)
stock.fleetInfo(fleets)
fleets |
is an objetc of class FLFleetsExt. |
Return a matrix with rownames equal to the stocks names and colnames equal to names of fleet and metier. If element (i,j) is equal to 0, the stock (i) is not caught by fleet/metier (j).
## Not run: data(multi) stock.fleetInfo(fl1) ## End(Not run)
## Not run: data(multi) stock.fleetInfo(fl1) ## End(Not run)
Extract landings, discards or catch at age of a stock from a FLFleetExt or FLFleetsExt object.
tlandStock(obj, stknm) tdiscStock(obj, stknm) landStock.f(obj, stock) discStock.f(obj, stock) catchStock.f(obj, stock) landWStock.f(obj, stock) discWStock.f(obj, stock) catchWStock.f(obj, stock) landStock(obj, stock) discStock(obj, stock) catchStock(obj, stock) landWStock(obj, stock) discWStock(obj, stock) catchWStock(obj, stock)
tlandStock(obj, stknm) tdiscStock(obj, stknm) landStock.f(obj, stock) discStock.f(obj, stock) catchStock.f(obj, stock) landWStock.f(obj, stock) discWStock.f(obj, stock) catchWStock.f(obj, stock) landStock(obj, stock) discStock(obj, stock) catchStock(obj, stock) landWStock(obj, stock) discWStock(obj, stock) catchWStock(obj, stock)
obj |
a FLFleetExt (.f) or FLFleetsExt object |
stknm |
stock name |
stock |
stock name |
landStock.f: Extract total landings at age in numbers of a stock from a FLFleetExt obj.
discStock.f: Extract total discards at age in numbers of a stock from a FLFleetExt obj.
catchStock.f: Extract total catch at age in numbers of a stock from a FLFleetExt obj.
landWStock.f: Extract total landings at age in weight of a stock from a FLFleetExt obj.
discWStock.f: Extract total discards at age in weight of a stock from a FLFleetExt obj.
catchWStock.f: Extract total catch at age in weight of a stock from a FLFleetExt obj.
landStock: Extract total landings at age in numbers of a stock from a FLFleetExts obj.
discStock: Extract total discards at age in numbers of a stock from a FLFleetExts obj.
catchStock: Extract total catch at age in numbers of a stock from a FLFleetExts obj.
landWStock: Extract total landings at age in weight of a stock from a FLFleetExts obj.
discWStock: Extract total discards at age in weight of a stock from a FLFleetExts obj.
catchWStock: Extract total catch at age in weight of a stock from a FLFleetExts obj.
tlandStock: Total landings of a stock across fleets and metiers
tdiscStock: Total discards of a stock across fleets and metiers
A FLQuant object with landings, discards or catch (total or at age).
## Not run: library(FLBEIA) data(one) landWStock.f(oneFl$fl1,"stk1") landWStock(oneFl,"stk1") ## End(Not run)
## Not run: library(FLBEIA) data(one) landWStock.f(oneFl$fl1,"stk1") landWStock(oneFl,"stk1") ## End(Not run)
This function transforms a FQuant with several 'unit' dimension into an array an unique 'unit' dimension and no 'area' dimension. Moving 'unit' to 'age' dimension. This is usefull when we use the 'unit' dimension to store the different seasonal cohorts.
unit2age(Q)
unit2age(Q)
Q |
A FLQuant. The object must be the output of FLBEIA function. |
A 4-dimensional array with length c(d[1]*d[3], d[2], d[4], d[6]), where d is the dimension of the FLQuant.
The files must contain a single object (named as objnam
value).
Updates an old FLBiols (where slots fec and mat from each FLBiol are FLQuants), into the new version of the class,
where slots fec and mat are of class predictModel
.
updateFLBiols(biols)
updateFLBiols(biols)
biols |
A FLBiols object. |
A new FLBEIA output object with all the iterations joined.
Mean weight at age in discards for a stock across fleets and metiers
wtadStock(obj, stknm)
wtadStock(obj, stknm)
obj |
An object of class FlFleetsExt. |
stknm |
Character. The name of the stock for which we want to calculate mean weight-at-age. |
A FLQuant with mean weight-at-age values.
Mean weight at age in landings for a stock across fleets and metiers
wtalStock(obj, stknm)
wtalStock(obj, stknm)
obj |
An object of class FlFleetsExt. |
stknm |
Character. The name of the stock for which we want to calculate mean weight-at-age. |
A FLQuant with mean weight-at-age values.