This function estimates abundances in mass at age (for recruits and adults) by period, given information on growth, periods duration, catches and some additional values.

calcPop(g, f, catch, inits)

Arguments

g

A vector with information on instantaneous rate of biomass decrease, g = M - G, for recruits (rec) and adults (adult).

f

A vector with fraction of the year corresponding to each of the periods (determined by the period of the year of the different indices).

catch

An FLQuant with catch information (for recruits and adults).

inits

An FLPar with parameter values for the parameters required by the bbm function.

Value

A list with two elements: stock.bio, with information on estimated stock (FLQuant); and ok, an indicator on whether estimated parameters are valid (i.e. positive, ok==TRUE) or not (ok==FALSE).

See also

Author

Leire Ibaibarriaga & Sonia Sanchez.

Examples


# Load required libraries
library(bbm)

# Load data
data(ane)

# Generate population estimates, given some estimated parameters
findicesB.ane <- unlist(lapply( indicesB.ane, function(x) mean(range(x)[c('startf','endf')])))
findicesP.ane <- unlist(lapply( indicesP.ane, function(x) mean(range(x)[c('startf','endf')])))
bioAge <- calcPop(g=control.ane@g, 
                  f=periods( findicesB=findicesB.ane, findicesP=findicesP.ane)$f, 
                  catch=catch.ane, inits=inits.ane)
class(bioAge)
#> [1] "list"

# Check if valid ouput (i.e. positive biomass values)
bioAge$ok
#> [1] TRUE

# Estimates
bioAge$stock
#> An object of class "FLQuant"
#> , , unit = unique, season = 1, area = unique
#> 
#>    year
#> age 1987  1988  1989  1990  1991  1992  1993  1994  1995  1996  1997  1998 
#>   1 80000 80000 80000 80000 80000 80000 80000 80000 80000 80000 80000 80000
#>   2 50000 55783 57709 63943 47778 52243 40577 32365 32805 36797 34580 43166
#>    year
#> age 1999  2000  2001  2002  2003  2004  2005  2006 
#>   1 80000 80000 80000 80000 80000 80000 80000 80000
#>   2 38728 41338 34441 28196 42474 54128 55866 68076
#> 
#> , , unit = unique, season = 2, area = unique
#> 
#>    year
#> age 1987  1988  1989  1990  1991  1992  1993  1994  1995  1996  1997  1998 
#>   1 59607 59703 60477 53794 58558 51489 56347 58653 56960 57970 58188 56801
#>   2 33810 42116 42824 48443 31489 36581 24610 16447 17647 24398 24233 31610
#>    year
#> age 1999  2000  2001  2002  2003  2004  2005  2006 
#>   1 60174 56449 57168 60266 61443 59569 61904 61741
#>   2 22240 27005 21419 16765 31370 40299 42686 52480
#> 
#> units:  NA