Skip to content

[Developer Issue]: Create modular function to generate selectivity curves from ecosystem model F values by functional group #14

@Bai-Li-NOAA

Description

@Bai-Li-NOAA

Description

Currently, the ecosystem model (EWE) model specifies fishing mortality by functional group, where functional groups can be thought of as age groups. We need to be able to look at the specified F for each functional group and use it to create a selectivity curve. The selectivity curve should be generated by specifying a form, e.g., logistic, double logistic, random walk at age, etc., with parameters that will create that exact form. Can you please create a function that will take three inputs, (1) the output from ecosystemom, (2) a vector of strings that contain the functional groups that are of interest where the vector is ordered in the same order that we want the x axis of the selectivity curve, and (3) the functional form that we want the selectivity curve to take where this will be a string that accepts either “logistic” or “double logistic” and we will be able to add more types later. The function will then use helper functions created by this PR, where we need one helper function for each available functional form. The helper functions will take an input vector of F values for each functional group. From these F values, it will then find the parameters that fit the selectivity the best using the functional form specified in the helper function. The global function will know which helper function to use based on the functional form that the user input. Each helper function will return the parameters required to fit the curve in a tibble format. We provide example tibbles for both the logistic and double logistic below. These parameters can then be used as input for a FIMS model to test the ability of the EM to fit to the data. The function should be modularized so that it will be easy to add new functional forms, e.g., “double normal”, “random walk at age”, at a later date.

The logistic and double logistic examples:

model_family	module_name	fleet_name	module_type	label	distribution_link	age	length	time	value	estimation_type	distribution_type	distribution
catch_at_age	Selectivity	fleet1	Logistic	inflection_point	NA	NA	NA	NA	2	fixed_effects	NA	NA 
catch_at_age	Selectivity	fleet1	Logistic	slope	NA	NA	NA	NA	1	fixed_effects	NA	NA

model_family	module_name	fleet_name	module_type	label	distribution_link	age	length	time	value	estimation_type	distribution_type	distribution
catch_at_age	Selectivity	fleet1	DoubleLogistic	inflection_point_asc	NA	NA	NA	NA	2	fixed_effects	NA	NA 
catch_at_age	Selectivity	fleet1	DoubleLogistic	slope_asc	NA	NA	NA	NA	1	fixed_effects	NA	NA
catch_at_age	Selectivity	fleet1	DoubleLogistic	inflection_point_desc	NA	NA	NA	NA	2	fixed_effects	NA	NA 
catch_at_age	Selectivity	fleet1	DoubleLogistic	slope_desc	NA	NA	NA	NA	1	fixed_effects	NA	NA

Metadata

Metadata

Labels

status: triage_neededThis is not approved for this milestone, do not work on it yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions