bbm: Method bbm

bbmR Documentation

Method bbm

Description

Function to fit a two-stage biomass-based model.

Usage

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)

Arguments

object

An FLQuant with catch information (in mass) or an FLStock. These objects must only have two age classes (recruits and adults) and the number of seasons should be 1 or the number of seasons determined by the timing of the different indices.

indicesB

Abundance indices in total biomass (element of class: FLQuants, FLQuant or FLIndices) from surveys. Please assign a survey name to each index.

indicesP

Percentage of recruits in biomass (element of class: FLQuants, FLQuant or FLIndices) from surveys. Please assign a survey name to each proportion.

findicesB

A vector with fraction of the year corresponding to each of the indicesB.

findicesP

A vector with fraction of the year corresponding to each of the indicesP.

control

A bbmControl with control arguments.

inits

An FLPar with initial values.

Value

An object of class bbmFit.

Author(s)

Leire Ibaibarriaga & Sonia Sanchez.

See Also

bbmFit, FLQuant, FLQuants, bbmControl, FLPar, bbmFLPar

Examples


# 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)

flr/bbm documentation built on Sept. 6, 2022, 8:56 p.m.