Prepare a TMB Objective Function for Optimising Model Parameters
Source:R/prepare_data.R
prepare_data.Rd
This function returns a list with the data to be passed to the TMB objective function. The data includes the observed catch data, the model parameters, and some precomputed values that are used in the likelihood calculation. The main preprocessing makes sure that we have a comprehensive set of bins that cover the entire size range, even though there will not be observations at all sizes. Missing observations should be interpreted as a 0 count.
Arguments
- params
A MizerParams object
- species
The species for which the data is to be prepared. By default the first species in the model.
- catch
A data frame containing the observed binned catch data. It must contain the following columns:
length
: The start of each bin.dl
: The width of each bin.count
: The observed count for each bin.
- yield_lambda
A parameter that controls the strength of the penalty for deviation from the observed yield.