Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recruitment deviation objects should be Nyrs-1? #27

Open
gavinfay opened this issue Oct 4, 2022 · 11 comments
Open

recruitment deviation objects should be Nyrs-1? #27

gavinfay opened this issue Oct 4, 2022 · 11 comments

Comments

@gavinfay
Copy link
Collaborator

gavinfay commented Oct 4, 2022

Recruitment in the first year is confounded with the initial N in the first size bin.
@sgaichas I addressed this (for now) by reducing the length of the recdev objects, thus recruitment only happens in years 2:Nyr.
Does this make sense?
To get things to work properly, the relevant .pin file vectors trimming by 1 year for each species if we stay with this. (done manually for now)

@gavinfay
Copy link
Collaborator Author

gavinfay commented Oct 4, 2022

Changed per above in fe484a6.

@sgaichas
Copy link
Collaborator

sgaichas commented Oct 4, 2022

This sounds reasonable.
I may be overthinking it, but does this assume N@sizebin1=Nrecruits? Recruits only go into bin1 but not all of bin1 is recruits since there can in theory be fish in that bin prior to recruitment (from a previous year), depending on growth combined with the bin size.
With Nstepsyr = 1, only the fastest growing species is out of the first bin in the first timestep, the others will have some proportion still in that bin in the next timestep (which is the next year) so recruits are added to a nonzero bin1.
Would an alternative be to define initial N at sizebin1 as "pre-recruitment" ? Then recruits can still get added in year 1. I'm not sure how to split that hair though, or if it makes anything easier.

@gavinfay
Copy link
Collaborator Author

gavinfay commented Oct 5, 2022

Yes, length bin 1 contains the new recruits plus those left from last year. But, as recruitment is the first thing that happens, in the initial year there is no way to distinguish the new recruits from those prior to the model start. As the N in length bin 1 is an estimated parameter then these are already being accounted for. One could use the expected recruitment (e.g. average for option 9) added on to N1, but can't have this first year value be an independent estimated parameter (rec dev).

@sgaichas
Copy link
Collaborator

sgaichas commented Oct 6, 2022

Sounds good. The new pin file code makes the recdev vector for Nyrs-1 thefaylab/hydradata@6861e68
and new input files and data object (that also fixed inpN and the indicatorFisheryq order) reflect this change in 265092a

@sgaichas
Copy link
Collaborator

sgaichas commented Oct 7, 2022

I'm not sure whether this change has unexpectedly altered models with more than one timestep per year--NOBA Cod fit ok in the previous model but is having problems now.

But other species don't share this and cod has its own fishery so was there a change in fishery specification as well? results from 5 bin model below

prior to change (should be identical inputs):
image

current recruitment config:
image

mortality, current config (no equivalent plot from earlier)
image

image

Fishery selectivity is flat for the 5 bin model
image

The 10 bin model in the current code shows a much less severe pattern (but still worse than before for cod) and estimates fishery selectivity that looks more reasonable

image
image
image

to be fair, actual selectivity for cod in NOBA is strange so maybe this new configuration is more accurately finding it difficult to deal with...

@sgaichas
Copy link
Collaborator

sgaichas commented Oct 8, 2022

The 5 bin model seems more sensitive to the M1 splitting calculation.
In my local code I reverted to

 M1(area, spp)  = 1.0 - pow((1.0 - M1ann(area, spp)), (1.0 / Nstepsyr))

resulting in M1 = 0.2085 rather than 0.2

With no other changes; the cod problem is less severe. It is behaving more like the 10 bin model (but still worse fit for cod).

image
image
image

skill plot for B shows it is picking up signals for haddock and herring pretty well
image

@gavinfay
Copy link
Collaborator Author

gavinfay commented Oct 8, 2022

I am having some similar issues with regard to recruitment and selectivity for some of the GB stocks with the 5 bin model. I haven't actually run the 10bin version of that with the recent files yet.
I will revert to your implementation of M1. I also have a local change where M1 is an (estimable) parameter, but fixing it for now. (so identical to the data file implementation). Though maybe it would also make sense to estimate something related to prey vulnerability if we were going to start doing this to truly allow the interactions to be estimated during fitting, e.g. like Vanessa's model. A discussion point for next week for sure.

@gavinfay
Copy link
Collaborator Author

gavinfay commented Oct 8, 2022

It probably also makes sense to have a 'last yr' specification for recruitment devs so that those at the end of the time series aren't estimated if they represent year classes not yet observed fully in fishery/surveys. (e.g. SS)

@sgaichas
Copy link
Collaborator

sgaichas commented Oct 8, 2022

I haven't made a 10 bin GB dataset yet, we would have to make some decisions about the input stomach weights and a few other currently fixed input parameters to make that work. The 10 bin NOBA takes many hours to run on my computer so may not be worth your time right now!
Yes that sounds good on the last year.

@gavinfay
Copy link
Collaborator Author

gavinfay commented Oct 8, 2022

Ah. Clearly my brain is mush. Sorry!

@sgaichas
Copy link
Collaborator

sgaichas commented Oct 8, 2022

My brain was too mushy to make those decisions for 10 bin. :-) still is!
The newest 5 bin GB data inputs do correct the fishery catch at length and have lower inpN than 100 though, so if you haven't tried them they may change things. Sorry about late changes to data...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants