gadget-framework / gadget3

TMB-based gadget implemtation
GNU General Public License v2.0
8 stars 6 forks source link

g3a_renewal_vonb_t0: t0 cannot equal an age #128

Open lentinj opened 8 months ago

lentinj commented 8 months ago

Whist messing with minimal modelwizard models.

Somewhat obviously in retrospect, if t0 is equal to one of our ages, then at that age the mean length will be 0. However, this is resulting in NaN's for that age.

I think the problem is g3a_initialconditions_normalcv(), and we should be avoid_zero()ing mean_f * cv_f. But I've not experimented further.

bthe commented 8 months ago

I guess we can do one more, t0 can't be greater than minimum age otherwise we get negative growths. Might be worthwhile to either to set a default upper bound to 0 or set t0 as -exp(log_t0).

lentinj commented 8 months ago

t0 can't be greater than minimum age otherwise we get negative growths

Certainly sounds sensible but it's not a solution in itself. In initialconditions we do (age - cur_step_size) - t0, so if (like anch) you have ages 0..3 then you in effect considering age == -1. But it's quite possible that this in itself is nonsensical.

bthe commented 8 months ago

Could the solution to this dilemma be to restrict the initial conditions to run only for ages minage + 1 and above and let the recruitment do its thing when that happens.

lentinj commented 8 months ago

I seem to remember @willbutler42 doing something similar to avoid double recruitment in the first step, although not sure where now.

willbutler42 commented 8 months ago

I seem to remember @willbutler42 doing something similar to avoid double recruitment in the first step, although not sure where now.

Will get back to you tomorrow regarding this