Skip to content

add sample_ages to wrappers to simulate ageing a subset of lengthed fish #42

@sgaichas

Description

@sgaichas

The way sampling is set up, effN for each survey is the number of fish measured for length, age, and average weight at age. We could introduce further realism by using the sample_ages() function to take a subsample for age composition and optionally apply an ageing error matrix (specified in the survey and fishery config files). The age comp based on a larger sample size and without error is still used to generate the length composition as input to calc_age2length, so we would have to run sample_ages after we generate lengths and weight at age.

This would require changing the om_comps() wrapper:

  1. move #save age comps lines to after the length comps and weight at age are saved
  2. add a step modifying the age_comp_data[[i]] object before the #save age comps lines by running sample_ages
  3. same two steps for fishery age comps, unless we age all the samples from fisheries
  4. add a step modifying the annage_comp_data[[i]] by running sample_ages (no need to shuffle because this is not an input to the length function

saved age comp objects remain the same
this still means weight at age is from an unrealistically large age sample, could fix later

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions