qBiomass: Applies q-adjustment to biomass and abundance data at the set...

Description Usage Arguments Details Value References See Also

View source: R/qBiomass.R

Description

Applies q-adjustments to biomass and abundance data at the set level and returns to the results to biomassData(). Length-based adjustments are applied for several functional groups; not length-based adjustments are applied for some species; no adjustment is applied for remaining species.

Usage

1
qBiomass(species, year, fun_group = NA, q = 0, len_corr = 1)

Arguments

species

Species code from the catch_coeffs table. This argument is supplied by biomassData().

year

Year to calculate the data, supplied by biomasData()

fun_group

Functional group from the catch_coeffs table. This argument is supplied by biomassData(). If fun_group = NA, then this q values is applied to all length classes.

q

Initial q-correction from the catch_coeffs table. This argument is supplied by biomassData(). If q > 0 and fun_group = NA, then this q value is applied to all length classes.

len_corr

Initial length correction from the catch_coeffs table. This argument is supplied by biomassData().

Details

qBiomass() is called by the biomassData() function. Arguments are supplied to qBiomass() from the catch_coefs table (SQL call to gomezc.indiseas_catchability_coeffs), which includes columns FUNGROUP, Q, and LENCORR for 88 SPECIES. qBiomass() loops over each row of this table for each year supplied to biomassData().

qBiomass() obtains numbers (ABUNDANCE) at length for the given species for 1 cm intervals from the groundfish database.

Biomass estimates are based on the length-weight relationship:

ln(Weight) = a + ln(Length) * b

The function obtains length and weight data for species in year from the groundfish database and estimates a and b. The average weight of fish at each length is then estimated using:

Weight_{Avg} = exp(a + ln(Length)*b)

and the biomass estimate is:

\code{BIOMASS} = \code{ABUNDANCE} * Weight_{Avg}

If there are less than 100 length-weight observations in the database for the given species in year, the function will include observations from the 5 years before and after year. If there are still less than 100 observations, data from all years will be included. This can result is some discrepancies when biomass data is extracted in different years.

q-correction

q is calculated based on the arguments fun_group and q.

If q > 0 and fun_group = NA, then a single q is applied for all length classes. Otherwise, q is calculated using the equation:

q = g1*(exp(a1+b1*(\code{LENGTH}*\code{lencorr})))/(1+exp(a1+b1*(\code{LENGTH}*\code{lencorr})))

where g1, a1, and b1 are hard-coded for each fun_group, len_corr is an argument provided by biomassData(), and LENGTH is the length interval (cm).

q-corrected abundance: \code{QABUNDANCE} = \code{ABUNDANCE}/q.

q-corrected biomass: \code{QBIOMASS} = \code{QABUNDANCE} * Weight_{Avg}

Value

Returns the not q-adjusted and q-adjusted length-based biomass and abundance to biomassData() for species that have q-adjustments.

References

Modified code from AC's ExtractIndicators/R/qBiomass (function biomass_q_adj())

See Also

Other RV functions: RVdataframe, biomassData, extractRV, stratifyBiomass, vesselCorr


dempseydanielle/SSdata documentation built on May 3, 2020, 5:09 p.m.