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

Error setting F = 0 in projections with random effects on M #20

Open
brianstock-NOAA opened this issue Aug 10, 2020 · 0 comments
Open
Labels
bug Something doesn't work

Comments

@brianstock-NOAA
Copy link
Contributor

Problem could be that in models with time-varying M, there's nothing to stop M from being so high that SPR0 is driven very low? In the model I'm looking at, SPR0 < 0.10 seems to be the threshold. When M is high and SPR0 < 0.10, R0 goes negative (a and b are constant, SPR0 must be > 1/a to have positive R0 on line 666. This happens for some model years though, and that doesn't make the nlminb call fail...

Could be the gradient calculations on lines 920-922 of helper_functions.hpp:

vector<Type> grad_spr_F = autodiff::gradient(sprF,log_FXSPR_i);
log_FXSPR_iter(y,i+1) = log_FXSPR_iter(y,i) - (sprF(log_FXSPR_i) - 0.01*percentSPR*exp(log_SPR0(y)))/grad_spr_F(0);// /hess_sr_yield(0,0);

In the NAA models that do not return an error when doing projections with F = 0, all of the reference point objects are also NaN in projection years. log_FXSPR_iter is NaN in columns 2-10, and all of these have NaN: log_FMSY, log_SPR_MSY, log_YPR_MSY, log_R_MSY, log_SSB_MSY, log_MSY. But no error.

When setting F = 0.001 in the projections, no NaN in any of the above.

@brianstock-NOAA brianstock-NOAA added the bug Something doesn't work label Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something doesn't work
Projects
None yet
Development

No branches or pull requests

1 participant