nmfs-ost / ss3-source-code

The source code for Stock Synthesis (SS3).
https://nmfs-ost.github.io/ss3-website/
Creative Commons Zero v1.0 Universal
38 stars 16 forks source link

INIT=0 of MG=parms for male found in control.ss of simple_small in r4ss #355

Open yukio-takeuchi opened 2 years ago

yukio-takeuchi commented 2 years ago

I am curios on the MG_parms parameter set up for male of simple_small model included recently in r4ss . MG_parms section of control file for simple_small model sets those for male as

# Sex: 2  BioPattern: 1  NatMort
 -3 3 0 0 99 0 -3 0 0 0 0 0 0 0 # NatM_uniform_Mal_GP_1
# Sex: 2  BioPattern: 1  Growth
 -3 3 0 0 99 0 -3 0 0 0 0 0 0 0 # L_at_Amin_Mal_GP_1
 -3 3 0 0 99 0 -3 0 0 0 0 0 0 0 # L_at_Amax_Mal_GP_1
 -3 3 0 0 99 0 -3 0 0 0 0 0 0 0 # VonBert_K_Mal_GP_1
 -3 3 0 0 99 0 -3 0 0 0 0 0 0 0 # CV_young_Mal_GP_1
 -3 3 0 0 99 0 -3 0 0 0 0 0 0 0 # CV_old_Mal_GP_1

So INIT (3rd colums) of NatM, L@Amin, L@Amax, VBk, CV_young and CV_old of male are 0. In p109 of the user manual of 3.30.19, effects of INIT=0 for male Lmin, Lmax and VBK is described. But rest of them didnot mention so. I am wondering, which male MG_parms are subject to INIT=0.

Thanks in advance

kellijohnson-NOAA commented 2 years ago

Thanks @yukio-takeuchi for the inquiry. The simple_small model uses offset option of 1

1 #_parameter_offset_approach for M, G, CV_G: ...

(link to previous line of code)

Thus, male parameters are set equal to female parameters if INIT = 0 and the phase is negative. It is my understanding that this is true for the natural mortality and growth parameters. The manual lists all parameters for which this type of offset works here. You can go to MGparm_By_Year_after_adjustments report:7 of the Report.sso file to see what the resulting parameter values are for both males and females.

One thing that might be confusing is that this model does not use INIT = 0 for Wtlen_1_Mal_GP_1 and Wtlen_2_Mal_GP_1, instead INITs are the same as the female parameters (which means they start estimation at the same place) even though the phase is negative. All that means here is that you could change the female INIT values and only the female parameters would change. You would have to change both the female and male INITs for these weight-length relationship parameters to make them match. I tested out using INIT 0 for the male wtlen parameters and the female parameters are NOT carried forward for these 2 male parameters using this approach, which is why @iantaylor-NOAA used actual values in both male and female INITs even though the phase is negative.

Please let me know if you have any additional questions. More information about offsets can be found in the manual in the offset section of the manual.

Rick-Methot-NOAA commented 2 years ago

We are working now on editing that section of the manual. I am surprised that the male=0 approach did not work for the wtlen parameters. The loop in which this occurs covers all MGparms

kellijohnson-NOAA commented 2 years ago

I was surprised too wrt it not working for the wtlen parameters. But, comments in the SS3 code here https://github.com/nmfs-stock-synthesis/stock-synthesis/blob/844f5de2b4b222f18fbadb9b93625ed91b7a2958/SS_readcontrol_330.tpl#L1562 suggest that this is the intended behavior.

Rick-Methot-NOAA commented 2 years ago

Right! That's what lets lines 40-47 of SS_biofxn do the female to male assignment by using the MGparm_offset created in readcontrol.

yukio-takeuchi commented 2 years ago

Thanks @kellijohnson-NOAA and @Rick-Methot-NOAA, I missed the foot note @kellijohnson-NOAA pointed out. I have one follow up question on CV_young and CV_old. In lines 140-159 of SS_biofxn.tpl seems that, if INIT of CV_young (or CV_old) of a growth pattern is less than or equal to 0, corresponding INIT of CV_young (or CV_old) of 1st growth pattern is substituted. WRT CVs, these assignments are also happening?

Rick-Methot-NOAA commented 2 years ago

Yukio,

Sorry that this final response got overlooked. I do not think I understand the question. The section of code you reference is where the two CV parameters (CVLmin and CVLmax) are first assigned a value. If the value being read is not positive, then the value for gp=1 is used.