LandingsData and data used to estimate lengthWeightParams must be in the same units. Lbs or MT

expand_landings_to_lengths(landingsData, lengthData, lengthWeightParams)

Arguments

landingsData

Tibble. Aggregated landings data. YEAR, QTR, NEGEAR, MARKET_CODE,landings_land (metric tonnes), landings_nn (# trips), len_totalNumLen (# fish lengths), len_numLengthSamples (# independent samples).

lengthData

Tibble. Aggregated length data. YEAR, QTR, NEGEAR, MARKET_CODE, LENGTH (length of fish), NUMLEN (# fish at LENGTH)

lengthWeightParams

List. alpha = intercept, betas = slope(s), var = residual variance used to formulate the mean (?see Notes section below)

Value

A Tibble of expanded landings to represent weight of landings by length

YEAR

Year of landings

NEGEAR

3 digit gear code as defined in cfdbs.gear

TIME

Quarter/Half year of landings (The presence of this field depends on whether it was present in the landingsData

MARKET_CODE

Market code assigned to landed fish (The presence of this field depends on whether it was present in the landingsData

LENGTH

Length of sampled fish

NUMLEN

number of sampled for fish stated LENGTH

weight

expanded weight (mt) of all fish of given LENGTH in YEAR, NEGEAR etc..

Notes

The length weight relationship (see fit_length_weight) is fit assuming log normal errors (normal on the log scale). Therefore when exponentiating a correction for the estimate is required:

E(W) = \(\alpha L^\beta exp(\sigma^2 / 2)\)

Expansion calculations

For each unique category (YEAR, TIME, NEGEAR, MARKET_CODE) weights (mean weights, metric tons) are attributed to the sampled individuals lengths using the weight-length relationship above. This distribution of weights by length is then scaled such that the sum of weights (over lengths) = the total landed weight from the landingsData. This scaling assumes that the landed (commercial) fish have the same length distribution as the sampled fish.