Function to generate indices of total biomass and of proportion of recruits in biomass, given information on catches at age, instantaneous rate of biomass decrease (g = M - G ) and values for the bbm parameters.

simIndices(object, ...)

# S4 method for FLQuant
simIndices(object, g, inits, findicesB = NULL, findicesP = NULL)

# S4 method for FLStock
simIndices(object, g, inits, findicesB = NULL, findicesP = NULL)

Arguments

object

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

g

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

inits

An FLPar with initial values.

findicesB

A vector with period of the year of the different indices in total biomass. Optional parameter, if not set, then the survey is assumed to occur at the beggining of the year.

findicesP

A vector with period of the year of the different indices of proportion of recruits in mass. Optional parameter, if not set, then the survey is assumed to occur at the beggining of the year.

Value

A list with indices in biomass (Btot) and indices in proportion of recruits (Prec), both elements of the list are FLIndices.

Methods

Methods exist for various calculations based on the output class (FLPar). For details: ?FLPar.

Author

Leire Ibaibarriaga & Sonia Sanchez.

Examples


# Load data
data(ane)

# Case:  object='FLQuant'
indices1 <- simIndices( catch.ane, g=control.ane@g, inits=inits.ane, 
                        findicesB=unlist(lapply( indicesB.ane, function(x) mean(range(x)[c('startf','endf')]))),
                        findicesP=unlist(lapply( indicesP.ane, function(x) mean(range(x)[c('startf','endf')]))) )
class(indices1)
#> [1] "list"
slotNames(indices1)
#> NULL


# Case:  object='FLStock'
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)

indices2 <- simIndices( stock, g=control.ane@g, inits=inits.ane, 
                        findicesB=unlist(lapply( indicesB.ane, function(x) mean(range(x)[c('startf','endf')]))),
                        findicesP=unlist(lapply( indicesP.ane, function(x) mean(range(x)[c('startf','endf')]))) )
class(indices2)
#> [1] "list"

# Run assessment with the alternative indices
run  <- bbm(catch.ane, indicesB=indicesB.ane, indicesP=indicesP.ane, control=control.ane, inits=inits.ane)
#> outer mgc:  2.991218 
#> outer mgc:  2.983554 
#> outer mgc:  2.994433 
#> outer mgc:  2.980339 
#> outer mgc:  2.989589 
#> outer mgc:  2.985185 
#> outer mgc:  2.990111 
#> outer mgc:  2.984663 
#> outer mgc:  2.986485 
#> outer mgc:  2.988286 
#> outer mgc:  2.987929 
#> outer mgc:  2.986843 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987385 
#> outer mgc:  2.987387 
#> outer mgc:  2.987385 
#> outer mgc:  2.987387 
#> outer mgc:  2.987382 
#> outer mgc:  2.98739 
#> outer mgc:  2.987383 
#> outer mgc:  2.987388 
#> outer mgc:  2.98738 
#> outer mgc:  2.987392 
#> outer mgc:  2.987369 
#> outer mgc:  2.987403 
#> outer mgc:  2.987363 
#> outer mgc:  2.987409 
#> outer mgc:  2.987322 
#> outer mgc:  2.98745 
#> outer mgc:  2.98723 
#> outer mgc:  2.987541 
#> outer mgc:  2.987124 
#> outer mgc:  2.987647 
#> outer mgc:  2.986773 
#> outer mgc:  2.987998 
#> outer mgc:  2.986082 
#> outer mgc:  2.988689 
#> outer mgc:  2.986608 
#> outer mgc:  2.988164 
#> outer mgc:  3.008474 
#> outer mgc:  2.96631 
#> outer mgc:  2.986905 
#> outer mgc:  2.987863 
#> outer mgc:  2.986374 
#> outer mgc:  2.988397 
#> outer mgc:  2.986725 
#> outer mgc:  2.988047 
#> outer mgc:  2.9823 
#> outer mgc:  2.992471 
#> outer mgc:  2.985849 
#> outer mgc:  2.988921 
#> outer mgc:  2.987386 
#> outer mgc:  2.991218 
#> outer mgc:  2.983554 
#> outer mgc:  2.994433 
#> outer mgc:  2.980339 
#> outer mgc:  2.989589 
#> outer mgc:  2.985185 
#> outer mgc:  2.990111 
#> outer mgc:  2.984663 
#> outer mgc:  2.986485 
#> outer mgc:  2.988286 
#> outer mgc:  2.987929 
#> outer mgc:  2.986843 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987386 
#> outer mgc:  2.987385 
#> outer mgc:  2.987387 
#> outer mgc:  2.987385 
#> outer mgc:  2.987387 
#> outer mgc:  2.987382 
#> outer mgc:  2.98739 
#> outer mgc:  2.987383 
#> outer mgc:  2.987388 
#> outer mgc:  2.98738 
#> outer mgc:  2.987392 
#> outer mgc:  2.987369 
#> outer mgc:  2.987403 
#> outer mgc:  2.987363 
#> outer mgc:  2.987409 
#> outer mgc:  2.987322 
#> outer mgc:  2.98745 
#> outer mgc:  2.98723 
#> outer mgc:  2.987541 
#> outer mgc:  2.987124 
#> outer mgc:  2.987647 
#> outer mgc:  2.986773 
#> outer mgc:  2.987998 
#> outer mgc:  2.986082 
#> outer mgc:  2.988689 
#> outer mgc:  2.986608 
#> outer mgc:  2.988164 
#> outer mgc:  3.008474 
#> outer mgc:  2.96631 
#> outer mgc:  2.986905 
#> outer mgc:  2.987863 
#> outer mgc:  2.986374 
#> outer mgc:  2.988397 
#> outer mgc:  2.986725 
#> outer mgc:  2.988047 
#> outer mgc:  2.9823 
#> outer mgc:  2.992471 
#> outer mgc:  2.985849 
#> outer mgc:  2.988921 
#> outer mgc:  282597.9 
#> Warning: NaNs produced
#> Warning: NaNs produced
run1 <- bbm(catch.ane, indicesB=indices1$Btot, indicesP=indices1$Prec, control=control.ane, inits=inits.ane)
#> outer mgc:  478.5962 
#> outer mgc:  478.5931 
#> outer mgc:  478.5976 
#> outer mgc:  478.5917 
#> outer mgc:  478.5936 
#> outer mgc:  478.5957 
#> outer mgc:  478.5946 
#> outer mgc:  478.5947 
#> outer mgc:  479.0729 
#> outer mgc:  478.1169 
#> outer mgc:  478.598 
#> outer mgc:  478.5914 
#> outer mgc:  478.5955 
#> outer mgc:  478.5938 
#> outer mgc:  478.5961 
#> outer mgc:  478.5933 
#> outer mgc:  478.5974 
#> outer mgc:  478.5919 
#> outer mgc:  478.6001 
#> outer mgc:  478.5892 
#> outer mgc:  478.6054 
#> outer mgc:  478.584 
#> outer mgc:  478.6158 
#> outer mgc:  478.5735 
#> outer mgc:  478.6363 
#> outer mgc:  478.553 
#> outer mgc:  478.6773 
#> outer mgc:  478.512 
#> outer mgc:  478.7575 
#> outer mgc:  478.4316 
#> outer mgc:  478.916 
#> outer mgc:  478.2719 
#> outer mgc:  479.2261 
#> outer mgc:  477.957 
#> outer mgc:  479.833 
#> outer mgc:  477.331 
#> outer mgc:  571.4646 
#> outer mgc:  385.7245 
#> outer mgc:  472.155 
#> outer mgc:  485.0337 
#> outer mgc:  480.8655 
#> outer mgc:  476.3062 
#> outer mgc:  480.1377 
#> outer mgc:  477.0352 
#> outer mgc:  475.5632 
#> outer mgc:  481.6299 
#> outer mgc:  477.5134 
#> outer mgc:  479.6765 
#> outer mgc:  478.0994 
#> outer mgc:  479.09 
#> outer mgc:  478.2988 
#> outer mgc:  478.8906 
#> outer mgc:  478.426 
#> outer mgc:  478.7634 
#> outer mgc:  478.5109 
#> outer mgc:  478.6785 
#> outer mgc:  478.594 
#> outer mgc:  478.5954 
#> outer mgc:  478.5947 
#> outer mgc:  478.5962 
#> outer mgc:  478.5931 
#> outer mgc:  478.5976 
#> outer mgc:  478.5917 
#> outer mgc:  478.5936 
#> outer mgc:  478.5957 
#> outer mgc:  478.5946 
#> outer mgc:  478.5947 
#> outer mgc:  479.0729 
#> outer mgc:  478.1169 
#> outer mgc:  478.598 
#> outer mgc:  478.5914 
#> outer mgc:  478.5955 
#> outer mgc:  478.5938 
#> outer mgc:  478.5961 
#> outer mgc:  478.5933 
#> outer mgc:  478.5974 
#> outer mgc:  478.5919 
#> outer mgc:  478.6001 
#> outer mgc:  478.5892 
#> outer mgc:  478.6054 
#> outer mgc:  478.584 
#> outer mgc:  478.6158 
#> outer mgc:  478.5735 
#> outer mgc:  478.6363 
#> outer mgc:  478.553 
#> outer mgc:  478.6773 
#> outer mgc:  478.512 
#> outer mgc:  478.7575 
#> outer mgc:  478.4316 
#> outer mgc:  478.916 
#> outer mgc:  478.2719 
#> outer mgc:  479.2261 
#> outer mgc:  477.957 
#> outer mgc:  479.833 
#> outer mgc:  477.331 
#> outer mgc:  571.4646 
#> outer mgc:  385.7245 
#> outer mgc:  472.155 
#> outer mgc:  485.0337 
#> outer mgc:  480.8655 
#> outer mgc:  476.3062 
#> outer mgc:  480.1377 
#> outer mgc:  477.0352 
#> outer mgc:  475.5632 
#> outer mgc:  481.6299 
#> outer mgc:  477.5134 
#> outer mgc:  479.6765 
#> outer mgc:  478.0994 
#> outer mgc:  479.09 
#> outer mgc:  478.2988 
#> outer mgc:  478.8906 
#> outer mgc:  478.426 
#> outer mgc:  478.7634 
#> outer mgc:  478.5109 
#> outer mgc:  478.6785 
#> outer mgc:  478.594 
#> outer mgc:  478.5954 
#> outer mgc:  80546.43 
#> Warning: NaNs produced
#> Warning: NaNs produced
run2 <- bbm(catch.ane, indicesB=indices2$Btot, indicesP=indices2$Prec, control=control.ane, inits=inits.ane)
#> outer mgc:  169.3892 
#> outer mgc:  169.3924 
#> outer mgc:  169.3883 
#> outer mgc:  169.3932 
#> outer mgc:  169.391 
#> outer mgc:  169.3905 
#> outer mgc:  169.3913 
#> outer mgc:  169.3902 
#> outer mgc:  169.4454 
#> outer mgc:  169.3362 
#> outer mgc:  169.4329 
#> outer mgc:  169.3487 
#> outer mgc:  169.3908 
#> outer mgc:  169.3907 
#> outer mgc:  169.3908 
#> outer mgc:  169.3907 
#> outer mgc:  169.3908 
#> outer mgc:  169.3907 
#> outer mgc:  169.3909 
#> outer mgc:  169.3906 
#> outer mgc:  169.391 
#> outer mgc:  169.3905 
#> outer mgc:  169.3912 
#> outer mgc:  169.3903 
#> outer mgc:  169.3916 
#> outer mgc:  169.3899 
#> outer mgc:  169.3924 
#> outer mgc:  169.3891 
#> outer mgc:  169.3939 
#> outer mgc:  169.3876 
#> outer mgc:  169.3971 
#> outer mgc:  169.3844 
#> outer mgc:  169.4032 
#> outer mgc:  169.3783 
#> outer mgc:  169.4154 
#> outer mgc:  169.3661 
#> outer mgc:  169.4392 
#> outer mgc:  169.3424 
#> outer mgc:  169.4859 
#> outer mgc:  169.2957 
#> outer mgc:  169.5775 
#> outer mgc:  169.2042 
#> outer mgc:  169.7507 
#> outer mgc:  169.0311 
#> outer mgc:  170.0678 
#> outer mgc:  168.7143 
#> outer mgc:  170.6887 
#> outer mgc:  168.0939 
#> outer mgc:  171.9194 
#> outer mgc:  166.864 
#> outer mgc:  174.2487 
#> outer mgc:  164.5352 
#> outer mgc:  160.7131 
#> outer mgc:  178.0697 
#> outer mgc:  169.9454 
#> outer mgc:  168.8361 
#> outer mgc:  169.4628 
#> outer mgc:  169.3188 
#> outer mgc:  169.3908 
#> outer mgc:  169.3892 
#> outer mgc:  169.3924 
#> outer mgc:  169.3883 
#> outer mgc:  169.3932 
#> outer mgc:  169.391 
#> outer mgc:  169.3905 
#> outer mgc:  169.3913 
#> outer mgc:  169.3902 
#> outer mgc:  169.4454 
#> outer mgc:  169.3362 
#> outer mgc:  169.4329 
#> outer mgc:  169.3487 
#> outer mgc:  169.3908 
#> outer mgc:  169.3907 
#> outer mgc:  169.3908 
#> outer mgc:  169.3907 
#> outer mgc:  169.3908 
#> outer mgc:  169.3907 
#> outer mgc:  169.3909 
#> outer mgc:  169.3906 
#> outer mgc:  169.391 
#> outer mgc:  169.3905 
#> outer mgc:  169.3912 
#> outer mgc:  169.3903 
#> outer mgc:  169.3916 
#> outer mgc:  169.3899 
#> outer mgc:  169.3924 
#> outer mgc:  169.3891 
#> outer mgc:  169.3939 
#> outer mgc:  169.3876 
#> outer mgc:  169.3971 
#> outer mgc:  169.3844 
#> outer mgc:  169.4032 
#> outer mgc:  169.3783 
#> outer mgc:  169.4154 
#> outer mgc:  169.3661 
#> outer mgc:  169.4392 
#> outer mgc:  169.3424 
#> outer mgc:  169.4859 
#> outer mgc:  169.2957 
#> outer mgc:  169.5775 
#> outer mgc:  169.2042 
#> outer mgc:  169.7507 
#> outer mgc:  169.0311 
#> outer mgc:  170.0678 
#> outer mgc:  168.7143 
#> outer mgc:  170.6887 
#> outer mgc:  168.0939 
#> outer mgc:  171.9194 
#> outer mgc:  166.864 
#> outer mgc:  174.2487 
#> outer mgc:  164.5352 
#> outer mgc:  160.7131 
#> outer mgc:  178.0697 
#> outer mgc:  169.9454 
#> outer mgc:  168.8361 
#> outer mgc:  169.4628 
#> outer mgc:  169.3188 
#> outer mgc:  80190.72 
#> Warning: NaNs produced
#> Warning: NaNs produced

# Plot assessed populations
plot( FLQuants( bc=quantSums(run@stock.bio)[,,,1,], alt1=quantSums(run1@stock.bio)[,,,1,], alt2=quantSums(run2@stock.bio)[,,,1,]))