calcPop: Function to estimate abundances

View source: R/calcPop_fun.R

calcPopR Documentation

Function to estimate abundances

Description

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.

Usage

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

Author(s)

Leire Ibaibarriaga & Sonia Sanchez.

See Also

FLPar, bbmFLPar

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)

# Check if valid ouput (i.e. positive biomass values)
bioAge$ok

# Estimates
bioAge$stock
 


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