Estimate true selectivity parameters from ecosystem model output
estimate_true_selectivity.RdThis function estimates selectivity curve parameters from ecosystem model fishing mortality-at-age data. It fits the curves using a Gamma distribution likelihood on un-normalized values to account for the mean-variance relationship.
Usage
estimate_true_selectivity(
data,
ages = NULL,
functional_form = c("logistic", "double_logistic")
)Arguments
- data
A tibble containing filtered ecosystem model output for a single species, typically generated by calling
load_model()followed bycalc_truth(). Must contain the columns: "species_name", "truth_label", "truth_type", "truth_time_step", "truth_group", "truth_year", "truth_unit", and "truth_value". The data should be pre-filtered to a single species; if multiple species are detected in the data, an error is issued.- ages
A named numeric vector where the names correspond exactly to the unique labels in the
truth_groupcolumn fromdata, and the values represent the actual structural or representative midpoint ages.For example:
ages = c("0" = 0, "1" = 1, "2+" = 2)orages = c("juvenile" = 1, "adult" = 4).If
NULL(default), the function will attempt to converttruth_groupdirectly into numeric values. If that fails, it will fall back to sequential indexing and issue a warning.- functional_form
A character string specifying the selectivity curve type. Currently supports "logistic" and "double_logistic".