bbm | R Documentation |
Function to fit a two-stage biomass-based model.
bbm(object, indicesB, indicesP, ...) ## S4 method for signature 'FLQuant,FLQuants,FLQuants' bbm(object, indicesB, indicesP, findicesB, findicesP, control, inits) ## S4 method for signature 'FLStock,ANY,ANY' bbm( object, indicesB, indicesP, findicesB = NULL, findicesP = NULL, control, inits ) ## S4 method for signature 'FLQuant,FLIndices,FLIndices' bbm( object, indicesB, indicesP, findicesB = NULL, findicesP = NULL, control, inits ) ## S4 method for signature 'FLQuant,FLQuant,FLQuant' bbm(object, indicesB, indicesP, findicesB, findicesP, control, inits)
object |
An |
indicesB |
Abundance indices in total biomass (element of class: |
indicesP |
Percentage of recruits in biomass (element of class: |
findicesB |
A |
findicesP |
A |
control |
A |
inits |
An |
An object of class bbmFit
.
Leire Ibaibarriaga & Sonia Sanchez.
bbmFit, FLQuant, FLQuants, bbmControl, FLPar, bbmFLPar
# Load data data(ane) # Case: object='FLStock'; indicesB=indicesP='FLIndices'; control='bbmControl'; inits='FLPar' stock <- FLStock(catch.n=catch.ane, catch.wt=catch.ane*0+1) units(stock@catch.wt) <- '' stock@catch <- quantSums(stock@catch.n*stock@catch.wt) run2 <- bbm(stock, indicesB=indicesB.ane, indicesP=indicesP.ane, control=control.ane, inits=inits.ane) # Case: object='FLQuant'; indicesB=indicesP='FLIndices'; control='bbmControl'; inits='FLPar' run3 <- bbm(catch.ane, indicesB=indicesB.ane, indicesP=indicesP.ane, control=control.ane, inits=inits.ane) # Case: object='FLQuant'; indicesB=indicesP='FLQuant'; control='bbmControl'; inits='FLPar' namdel <- c("q_acoustic","psi_acoustic","xi_acoustic") # we will take only one of the indices --> need to delete the parameters related to other indices control <- control.ane control@param.fix <- control@param.fix[dimnames(control@param.fix)$params[!dimnames(control@param.fix)$params %in% namdel],] inits <- inits.ane[dimnames(inits.ane)$params[!dimnames(inits.ane)$params %in% namdel],] run4 <- bbm( catch.ane, indicesB=indicesB.ane[[1]]@index, indicesP=indicesP.ane[[1]]@index, findicesB=c( depm=(indicesB.ane[[1]]@range[['startf']]+indicesB.ane[[1]]@range[['endf']])/2), findicesP=c( depm=(indicesP.ane[[1]]@range[['startf']]+indicesP.ane[[1]]@range[['endf']])/2), control=control, inits=inits) # Plot assessed populations runs <- list(run2=run2, run3=run3, run4=run4) biomass <- FLQuants(lapply(lapply(runs, stock.bio), quantSums)) plot(biomass)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.