|
Rceattle C++ template
The CEATTLE likelihood: src/TMB/ceattle.cpp and its headers
|
Go to the source code of this file.
Functions | |
| template<class Type> | |
| void | organize_diet_obs (const int &nspp, const int &nyrs, const int &nyrs_hind, const int &styr, const vector< int > &minage, const vector< int > &nsex, matrix< Type > &diet_obs, matrix< int > &diet_ctl, array< Type > &diet_prop) |
| Parses empirical diet observations and maps them into a 5D proportion array. | |
| template<class Type> | |
| void | calculate_other_food_diet_prop (const int &nspp, const int &nyrs, const vector< int > &nsex, const vector< int > &nages, const vector< Type > &other_food, array< Type > &diet_prop, array< Type > &other_food_diet_prop) |
| Residual stomach content: the "other food" not explicitly modeled. | |
| template<class Type> | |
| void | predict_stomach_content (const int &nspp, const int &nyrs_hind, const int &styr, const vector< int > &suit_styr, const vector< int > &suit_endyr, const vector< int > &minage, const vector< int > &nsex, const vector< int > &nages, matrix< Type > &diet_obs, matrix< int > &diet_ctl, array< Type > &avgN_at_age, array< Type > &diet_prop_hat, matrix< Type > &diet_hat) |
| Expected stomach content proportions given the modeled population state. | |
| void calculate_other_food_diet_prop | ( | const int & | nspp, |
| const int & | nyrs, | ||
| const vector< int > & | nsex, | ||
| const vector< int > & | nages, | ||
| const vector< Type > & | other_food, | ||
| array< Type > & | diet_prop, | ||
| array< Type > & | other_food_diet_prop ) |
Residual stomach content: the "other food" not explicitly modeled.
The unattributed diet share divided by other_food (mt) is on the same per-biomass scale as stom_div_bio, which calculate_msvpa_suitability() sums over prey and adds it to.
Definition at line 97 of file diet_data.hpp.
| void organize_diet_obs | ( | const int & | nspp, |
| const int & | nyrs, | ||
| const int & | nyrs_hind, | ||
| const int & | styr, | ||
| const vector< int > & | minage, | ||
| const vector< int > & | nsex, | ||
| matrix< Type > & | diet_obs, | ||
| matrix< int > & | diet_ctl, | ||
| array< Type > & | diet_prop ) |
Parses empirical diet observations and maps them into a 5D proportion array.
Maps diet_obs proportions onto the 5D diet_prop array used for MSVPA based suitability, handling 1-sex and 2-sex indexing. A row with flt_yr == 0 is written to every modeled year. Rows aggregated over predator or prey ages are skipped: only diet-data type 1 (a prey age in a predator age) can be used for MSVPA suitability.
| nspp | Number of species. |
| nyrs | Years, hindcast plus projection. |
| nyrs_hind | Years in the hindcast. |
| styr | First year of the model. |
| minage | Minimum modeled age per species. |
| nsex | Sexes modelled per species: 1 = combined, 2 = both. |
| diet_obs | Diet observations; column 0 sample size, column 1 the proportion. |
| diet_ctl | Maps each observation row to predator, prey, sexes, ages, and year. |
| diet_prop | [Output] Observed diet proportions (pred_idx, prey_idx, pred_age, prey_age, yr). Modified by reference. |
Definition at line 24 of file diet_data.hpp.
| void predict_stomach_content | ( | const int & | nspp, |
| const int & | nyrs_hind, | ||
| const int & | styr, | ||
| const vector< int > & | suit_styr, | ||
| const vector< int > & | suit_endyr, | ||
| const vector< int > & | minage, | ||
| const vector< int > & | nsex, | ||
| const vector< int > & | nages, | ||
| matrix< Type > & | diet_obs, | ||
| matrix< int > & | diet_ctl, | ||
| array< Type > & | avgN_at_age, | ||
| array< Type > & | diet_prop_hat, | ||
| matrix< Type > & | diet_hat ) |
Expected stomach content proportions given the modeled population state.
Maps diet_prop_hat back onto the rows of the empirical diet_obs, which are often aggregated over ages or sexes. The four diet-data types, as the ages encode them:
| nspp | Number of species. |
| nyrs_hind | Years in the hindcast. |
| styr | First year of the model. |
| suit_styr | Start year index of the suitability window, per predator. |
| suit_endyr | End year index of the suitability window, per predator. |
| minage | Minimum modeled age per species. |
| nsex | Sexes modelled per species: 1 = combined, 2 = both. |
| nages | Age bins per species. |
| diet_obs | Empirical diet observations, used here for row-matching. |
| diet_ctl | Maps each observation row to its aggregation levels. |
| avgN_at_age | Average numbers-at-age (thousands of fish), used for weighting. |
| diet_prop_hat | Predicted diet proportions for specific ages/sexes. |
| diet_hat | [Output] Predicted diet proportions matching diet_obs. |
Definition at line 161 of file diet_data.hpp.