Prepare a TMB Objective Function for Optimising Model Parameters
Source:R/prepare_data.R
prepare_data.RdThis 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:
gear: The gear used to collect the catch (optional if there is only a single gear).length: The start of each bin.dl: The width of each bin.catch: The observed count for each bin.