Forums

Back

Does not show complete result

JW
Jintao Wang, modified 2 Years ago.

Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

Hi all,

I have catch and mean weight at age data for one fleet. And I included mean weight at age in the data file. But it does not show complete result, and the landings data in the result is different from data file. The warning is poor convergence in Btarget search 0.000254308 0.000635771. I am using V3.30.16.00, and attached the files. Does anyone have some good suggestions?

 

Thank you

MC
Massimiliano Cardinale, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 40 Join Date: 2/23/17 Recent Posts

I am not sure, but it looks like you are attemtping to use mean weight at age data in the data file, which should go to the wtatage.ss file instead. However, I also notice that the mean weight at age data are weird (all last age classes have weight of 20 compared to something between 0 and 1 for the others).

Max

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts
Massimiliano Cardinale:

I am not sure, but it looks like you are attemtping to use mean weight at age data in the data file, which should go to the wtatage.ss file instead. However, I also notice that the mean weight at age data are weird (all last age classes have weight of 20 compared to something between 0 and 1 for the others).

Max

Thank you for your reply. But last age class(20) is simple size. And I am also confused what is the difference between putting mean weight at age into data file and wattage file, after all as the manual says it works in both places.

 

 

 

MC
Massimiliano Cardinale, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 40 Join Date: 2/23/17 Recent Posts

Dear

 

I have made some modifications to the files and now the model runs and converges without major issue, fitting the data reasonably (even if I dont even know which stock is this:))

Major changes

1. The starter file was modified to get the full results, I made also some small changes to it so you need to verify is what you intend to do here. Anyhow, at least now, when plotting, you can see the model results in full version.

2. Your model is an age based model (no lenght info used), so you dont need to estimate growth.

3. R0 was set too low, I have changed it. Also, generally it is hard to estimate steepness, so best for now to fix it to a reasonable value but you might profile it together with sigmaR.

4. I have used the weight at age option instead of adding weight at age data in the data file, I found it more easy to handle but up to you. The weight at age file I have created contains your data but the fecundity slot (-2) needs to be amended, for now is only the weight at age but it should be weight at age x maturity.

5. I have also changed selectivity to random walk (option 17). You seems to have rather high quality age data so option 17 is generally superior in this situation. However, you might want to estimate not all parameters although they seem to be all rather well defined in the model. Or of course, you might revert to spline.

6. I have changed to the float option for the survey CPUE so that the model has one less parameter to estimate without impacting the model results (did some trial).

7. I havent changed recdev part so this needs attention as well. 

 

Cheers

Max

MC
Massimiliano Cardinale, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 40 Join Date: 2/23/17 Recent Posts

Also, I have not changed the forecast file for now but this might also need some modifications although I would need to know what you intend to do with the model in order to do that properly.

Cheers

Max

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts
Massimiliano Cardinale:

Also, I have not changed the forecast file for now but this might also need some modifications although I would need to know what you intend to do with the model in order to do that properly.

Cheers

Max

Hi Max,

There are very useful suggestions. But the results(SSB、R、biomass...) are several times larger than expected, what else do I need to adjust?

 

I did the regime shift test for recruitment, and there are four different regimes, after debugging the base model, I want to use time block function in order to find the difference of biomass and forecast caused by regime shift.

Cheers

 

 

Attachments:

Richard Methot, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 219 Join Date: 11/24/14 Recent Posts

Great response Max.  Let me just add some explanation regarding body weight-at-age.

Max got the model working by setting it up like many age-structured integrated models.  This approach reads the body weight-at-age as empirical inputs  from the file wtatage.ss.  SS knows to read this file by setting this flag at the top of the control file:

1  # 0 means do not read wtatage.ss; 1 means read and use wtatage.ss and also read and use growth parameters
When this flag is set, SS ignores body weight information generated from the growth curve.  As Max said, selectivity should be specified as age-base; length-selectivity will probably produce spurious results.  Alas, we have not yet automated a change to the report settings such that growth based information is not displayed in the output, nor have we removed the reading of growth parameters from the input files.  That's on the wishlist.

0  # 0 means do not read wtatage.ss; 1 means read and use wtatage.ss and also read and use growth parameters
When the flag is not set, then is not read and SS will generate body weight-at-age information for the population from the growth parameters and, for the fleets, taking into account length selectivity.

This second approach requires accurate growth parameters.  These can be determined external to SS, or estimated in SS if informative data are provided.  Some types of informative data are mean body length-at-age, mean body weight-at-age, conditional age-at-length (which is the age composition for a specified range of lengths, e.g. each row of the age-length key).  Modal progression in length composition data is also somewhat informative.  On the wishlist is growth increment data from tag-recapture studies.

I hope this helps add to the good info Max provided..

Rick

 

Richard Methot, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 219 Join Date: 11/24/14 Recent Posts

Here are a couple of suggestions:

First is to check the units in your files relative to SS conventions.  SS expects body wt in kg, catch weight in tonnes, numbers of fish in 1000s.

If those are correct, then it is possible that the overall trends in your data are not informative regarding the scale of the population.  One investigative approach is to profile over a range of fixed values for the model parameter ln_B0, which sets the scale of recruitment.

Rick

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

I check the data again that the units of catch weight and SSB are right.   Does the lnB0 refer to the SR_LN(R0)? This fleet accounted for 60% of the total catch, could that be the reason?

MC
Massimiliano Cardinale, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 40 Join Date: 2/23/17 Recent Posts

I also suspect that the units of the landings are most likely expressed in kg and not in tonnes. The WAA seems more reasonable. By the way, which stock is this one?

Cheers

Max

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

It’s so complex that I only use one fleet which accounted for 60% of the total catch to run the model. This is Jack Mackerel with four fleets and seven survey data. There are catch and length at age data from different fleets,in this situation, do growth parameters need to be estimated? How do I determine if other cpue need to be set to float? And there are four mean weight at age data, how to fill in fleet(-2) in wtatage file.

MC
Massimiliano Cardinale, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 40 Join Date: 2/23/17 Recent Posts

In that case, it is really a large stock as it has catches over 4 millions ton, I have rarely read about such huge stocks except the classical Peruvian anchoveta and Alaskan Pollock. Just by curiosity, could you tell us which stock is this? 

I am note sure which is the issue but surely you should include the other 40% of the catches from the other fleets if you want to have a reasonable assessment of the stock.

Max

Richard Methot, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 219 Join Date: 11/24/14 Recent Posts

Sorry for being imprecise in my message.  I was referring to SR_LN(R0) parameter as a good candidate for profiling.

Here is another possible cause for the model result to have estimates of stock biomass that are much higher than the catch:  If the selectivity for a fleet is dome-shaped or strongly shifted to older ages, the catch will be coming from a subset of the ages and the high biomass could be in other ages. 

Rick

Richard Methot, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 219 Join Date: 11/24/14 Recent Posts

I have looked over your input files and find that they have some complexities that are unnecessary and will cause conflicts.  In particular, the use of length data and length-selectivity in combination with use of empirical weight-at-age input is not advised.  Also, you commented that you are only using the catch data from one fleet, but the input files have catch for four fleets.  It will take me a couple of days to get back to working on your request, but I will try to get in configured to work properly.   In the meantime, I suggest that you look at the empirical wtatage example in our examples folder:  https://vlab.noaa.gov/web/stock-synthesis/document-library/-/document_library/0LmuycloZeIt/view/11684751?_com_liferay_document_library_web_portlet_DLPortlet_INSTANCE_0LmuycloZeIt_redirect=https%3A%2F%2Fvlab.noaa.gov%3A443%2Fweb%2Fstock-synthesis%2Fdocument-library%2F-%2Fdocument_library%2F0LmuycloZeIt%2Fview%2F11684741

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

The sincerity anticipates your reply. The first attachments uploaded are for one fleet, while the new attachments are for four fleets

KD
Kathryn Doering, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 57 Join Date: 2/19/19 Recent Posts
Hello Jintao, 

Just following up on this forum chain - which questions remain unanswered for you?

Thanks,
Kathryn

Kathryn Doering (Pronouns: she/her)

Scientific Programmer III, Contractor with Caelum in support of
NOAA Fisheries, NWFSC  |  U.S. Department of Commerce

www.fisheries.noaa.gov




On Tue, Jun 29, 2021 at 11:03 PM Jintao Wang <VLab.Notifications@noaa.gov> wrote:

The sincerity anticipates your reply. The first attachments uploaded are for one fleet, while the new attachments are for four fleets


--
Jintao Wang Stock Synthesis Virtual Lab Forum https://vlab.noaa.gov/web/stock-synthesis/public-forums/-/message_boards/view_message/16170648 VLab.Notifications@noaa.gov
JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

Thank you. I do want to ask for time block function---how to set different parameters in different period. For example, how to set M=0.2 in 1970-2010, and M=0.3 in 2010-2020.

1 #_Nblock_Patterns
 2 #_blocks_per_pattern 
# begin and end years of blocks
 1970 1990 1991 2020 # pattern 1

0.2 0.3 0.2 0.1 0.8 0 -3 0 0 0 0 0 1 0 # NatM_p_1_Fem_GP_1

KD
Kathryn Doering, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 57 Join Date: 2/19/19 Recent Posts

Hi Jintao,

 

Thanks for the question - there are several ways of setting up time blocks, which are outlined in the "Using Time-Varying Parameters" section of the 3.30.17 user manual.

This example model with time varying growth (using time blocks) illustrates one setup, in case having an example model is helpful. Another resource which shows example setups for time blocks is the control file helper spreadsheet.

Here is one way of setting up M=0.2 in 1970-2010, and M=0.3 in 2010-2020. (Assuming the years of the model are from 1970-2020). This case is showing the "offset" way of using time blocks, the time block is offset from the base value. A additive functional form for the time blocks is used.

The block section:

1 #_Nblock_Patterns
1 #_blocks_per_pattern 
# begin and end years of blocks
 1970 2010 # pattern 1

The M long parameter line:

0.2 0.4 0.3 0.1 0.8 0 -3 0 0 0 0 0 1 1 # NatM_p_1_Fem_GP_1 ; base value is M = 0.3, and uses the additive functional form for the blocks.

Below the MG long parameter lines, an additional short parameter line is also needed for each time block. (assumes that AUTOGEN is turned off for the MG parms section). The initial value of -0.1 and a negative phase should set M = 0.2 for 1970-2010, since the base M value is 0.3:


#_       LO           HI          INIT         PRIOR   PR_SD     PR_type    PHASE  #  parm_name
           -0.3            1             -0.1             0            99             0                  -3           # Block_pattern_1_1970_2010

1 short parameter line is needed per block in the pattern; there is only 1 line here because there is only 1 block in pattern 1.

 

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

Thank you, it works! And I wonder if there is any function that allows this parameter to have a specific value every year.

KD
Kathryn Doering, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 57 Join Date: 2/19/19 Recent Posts

Hi Jintao,

Yes, using the other time varying options within SS would allow this.

To input fixed values for each year, I think the easiest way to do this would be to use an environmental link time varying option. There are examples of environmental links within the control file helper spreadsheet.

To allow for deviations around a value, the parameter deviations time varying option probably makes the most sense.

Feel free to ask for more details about these options if needed!

Thanks,

Kathryn

 

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

Hi Kathryn,

I want to ask more about environment link time varying option. The M has different values for each year, and I have put those values in data file. But when I add the short line(time-vary parameters line), the model can not run, do you have suggestions to figure it out?

Thanks.

KD
Kathryn Doering, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 57 Join Date: 2/19/19 Recent Posts

Hi Jintao,

 

Just a few changes to the control file were necessary to get the model running.

 

1. I changed AUTOGEN from

0 0 0 0 0 # autogen: 1st element for biology, 2nd for SR, 3rd for Q, 4th reserved, 5th for selex

to

1 0 0 0 0 # autogen: 1st element for biology, 2nd for SR, 3rd for Q, 4th reserved, 5th for selex

(Note: use all 1s to turn off autogen for all parameter sections)

 

2. The M parameter line needs the  link and then parameter number specified in a 3 digit number, so 

0.2 0.4 0.23 0.1 0.8 0 -3 1 0 0 0 0 0 0 # NatM_p_1_Fem_GP_1

became

0.2 0.4 0.23 0.1 0.8 0 -3 201 0 0 0 0 0 0 # NatM_p_1_Fem_GP_1

(the use of a 2 means an additive link,  see the 3.30.17 user manual for other link options.)

 

This should be enought to get the model running, however there were a few additional steps to make the model make more sense:

3. Loosen the bounds on the M paramter line to allow higher values of M than 0.4. 

0.2 0.4 0.23 0.1 0.8 0 -3 201 0 0 0 0 0 0 # NatM_p_1_Fem_GP_1

becomes

0.2 2 0.23 0.1 0.8 0 -3 201 0 0 0 0 0 0 # NatM_p_1_Fem_GP_1

 

4. The short parameter line represents the scalar on the environmental link when using the additive link (See using time-varying paramters in the 3.30.17 user manual for the equations):

M for the year = base M in long parameter line (0.23 in this case) + M in datafile for the year * short parameter line scalar

 

In order to just add the values in the data file directly to the base M, I changed: 

0.2 0.4 0.23 0.1 0.8 0 -3 #_placeholder when no time-vary parameters

to

0  2   1   0.1   0.8    0   -3 # scalar on the env parameter.

So that 1 is the scalar. This means the final value of M for the year is just the base paramter + the value for the year in the data file.

 

To verify the values used in the model, they should be in a table in the report file labelled : MGparm_By_Year_after_adjustments . There should also be a plot of M generated using r4ss::SS_plots

 

Feel free to post again if I have left any questions unanswered, the setup for using time varying parameters can be complex.

 

Hope this helps,

Kathryn

Attachments:

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

Hi Kathryn,

I have some question about time block, what is the difference between using time block function with parameter M and SR_H? I want to use two SR relationships in different period by using different H, but it cannot run.

 

Attachments:

KD
Kathryn Doering, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 57 Join Date: 2/19/19 Recent Posts

Hi Jintao,

 

The setup for time blocks with M and steepness are the same, but the short parameter lines go after the SR parameters section when adding a time block on steepness (short tv parameter lines always follow the long parameter line section in which they were implemented). Two changes were needed to get this control file working with the other previous model files:

 

1. I commented out the short MG parameter line, as there wasn't a short MG parameter in this model

# timevary MG parameters 
#_ LO HI INIT PRIOR PR_SD PR_type PHASE
   -0.3            1             -0.1             0            99             0                  -3           # Block_pattern_1_1970_1999

 

to

# timevary MG parameters 
#_ LO HI INIT PRIOR PR_SD PR_type PHASE
#  -0.3            1             -0.1             0            99             0                  -3           # Block_pattern_1_1970_1999

 

 

2. I added in a short parameter line in the SR parameter section, since now steepness has a time block:

after    0    0    0    0    0    0  -99    0    0    0    0    0    0    0 # SR_autocorr

added: 

#_ LO  HI INIT PRIOR PR_SD PR_type PHASE
 -1    1  -0.1  0     99     0      -3 # Block h tv parameter 

 

1 additional trick for short parameter lines, if it is uncertain where they go or how many needed, is to turn AUTOGEN for the section from 0 to 1 and get rid of all short parameter lines. Then, run the model (-stopph 0 -nohess can be used to run without estimation) , and look at the lines produced in the control.ss_new file to see which short parameter lines are needed and modify the values based on the desired configuration.

 

Hope this helps,

Kathryn

 

Attachments:

JW
Jintao Wang, modified 2 Years ago.

RE: Does not show complete result

Youngling Posts: 34 Join Date: 8/9/16 Recent Posts

Thank you very much.