johnrsibert / tagest

Suite of software for spatially resolved fish tagging analysis
BSD 2-Clause "Simplified" License
3 stars 2 forks source link

Fix to halfproc.cpp #11

Closed tom-peatman closed 7 years ago

tom-peatman commented 7 years ago

Hi John,

As mentioned previously, when developing rdensitysim, it looked like rhalflife was calculating halflives based on tag numbers at time step 1 (but estimating halflife as if it were tag numbers at time step 0).

Intialisation of zonesum0 within the start month loop appears to be causing this (as this results in zonesum0 being set to curr_sum for year_month = start_date, when calling halfcomp).

There's probably many ways of addressing this, but I think the simplest would be commenting out the (re)intialisation of zonesum0 within the start month loop - the approach I've taken here.

I've double-checked by calculating halflives with no advective movement, no fishing mortality and uniform diffusion, and the halflife estimates are over-estimated by 1 month (compared to simply estimating halflife with natural mortality).

Thanks, Tom