timjmiller / wham

State-space, age-structured fish stock assessment model
https://timjmiller.github.io/wham
Other
32 stars 16 forks source link

Growth #74

Closed GiancarloMCorrea closed 1 year ago

GiancarloMCorrea commented 1 year ago

Size-specific information can now be incorporated into WHAM. Growth estimation is now possible through several approaches. New selectivity functions available: double-normal. Aging error can now be incorporated. Documentation is available.

GiancarloMCorrea commented 1 year ago

Here are some more general testing that would be advisable for someone (not Giancarlo) to work on at some point. Giancarlo feel free to comment on these if you have done some already.

In general, a lot of testing is required (a lot of new features!) and not all of them have been tested. This will certainly take some time to do.

1. Confirm that projection capabilities work OK. I saw that len-selex is not allowed for proj years, and I don't think we tested this much at all.

Projections work but only use selex-at-age during the projection period. TODO: make it work for len-selex. It won't be too difficult, I think.

2. Check for sparsity patterns in new random effects

TODO

3. Test how computation scales with increasing n_ages/n_lengths/n_years w/ and without CAAL and marginal lengths. This would help identify areas where we could speed things up. For instance pred_caal is calculated for all years even those without data which is unnecessary  for the likelihood calcs.

We will do something like this in second paper, right?

4. Confirm that OSA and simulation is working correctly for different combinations of options.

Several combinations to test, but agree!

5. @timjmiller could confirm the usage of bias correction is sufficient. PE correction is not done on the new random effects e.g.

Edit: also flag in your PR message that this adds length selex, double-normal age selex, and ageing error which are all new features

GiancarloMCorrea commented 1 year ago

Giancarlo, I really enjoyed going through the R code and learned a lot. The only things I didn't look at were the cpp and hpp files and the diffs on wham_plots_tables.R (I'm really no good at base R plotting). I focused on formatting, documentation, and just making sure the code made sense (even though there were times I didn't fully understand it). I had a series of small in-line comments and otherwise my only general recommendations are:

1. document your "basic info" assumptions for length bins, growth, and L-W.

They are documented in ?prepare_wham_input

2. if possible, it would be nice if hard-coded indexing within functions was better documented. i think this would take a bit more time than you probably have, but maybe we can discuss it and i can go through the code again to try to clean that up.

Hmm not sure what you mean. We can discuss it later.