pdolder / MixFishSim

Code for mixed fishery multi-stock simulation model
GNU General Public License v3.0
3 stars 3 forks source link

Population dynamics parameters #10

Closed Blevy2 closed 2 years ago

Blevy2 commented 2 years ago

Hi Paul,

I have been working on a parameterizing a model using inputs for real species and came across a few things in the code related to the population dynamics section that I had to edit. They were fairly easy to work around but I figured I would mention them here in case you felt the source code should be edited or in the event anyone else is searching for an answer to similar questions later.

First, when I was trying to apply different prerecruit vs fully recruited weights I noticed that they are hard coded in run_sim.R in these lines, with wt = 1 and wtm1 = 0.1. I edited my init_pop script to input and stores these values when others dem_params are created and call them in that part of the run_sim code.

Second, the natural mortality rate M is hard coded as M/365 in the same lines as above. This is no problem if running on a daily time scale, but when I changed to weekly time steps I had to edit this part of run_sim. This is just a user-specific item that I thought would be helpful to mention here.

Third, the growth parameter K (where rho = e^-K) is discussed as having units yr^-1 in the paper and the value used in the simulation appears to also be yearly (K=0.3 so that 1+ rho = 1.74). However, the growth is applied on a daily time scale (or in my case, a weekly time scale). From what I have seen K is typically estimated as a yearly value and since it is a growth rate scaling is not as simple as dividing by 365. I was able to scale K to a weekly value using the following approach. Given a yearly K I want to calculate a weekly K such that (1+e^-K) = (1+e^-K)^52. Solving for K* is there is easy and allows what appears to the the correct weekly growth. One could follow a similar approach with the exponent ^365 for a daily value.

Hopefully these are helpful!

best,

Ben

pdolder commented 2 years ago

Hi Ben,

Sorry for the slow response.... These are really helpful suggestions and I've incorporated them all. Definitely good to have the increased flexibility / reduce potential for misspecification; I guess when I was coded I was thinking about my specification application but these changes were easy to make.

I have made the changes so that wt and wtm1 are user input, and specified in init_pop. I've left the 1 and 0.1 values as default inputs for backwards compatibility.

For M I've removed the hard-coding of /365, and updated the helpfile to indicate the need to adjust this parameter based on the time step in the population model.

For K I've done similarly to M, indicating the steps needed to parameterise based on an annual K as you've suggested.

Many thanks for your input, I hope all's going well.

Paul