Question about fixing recdev to 0

38 views
Skip to first unread message

Marta Cousido

unread,
Apr 24, 2025, 4:43:46 AMApr 24
to SS3 - Forum

Dear SS experts,

I'm working on the Southern stock of hake (Cantabrian Sea and Atlantic Iberian waters), and I’d like to ask the following question.

This year in the ICES assessment group, I should replace the recruitment estimate in the last year of data with the value from the stock-recruitment curve (i.e., set the recruitment deviation to 0) before running projections.

To do this, I edited the ss.par file manually and set the recruitment deviation for that year to 0. Then, I ran the command:


ss -maxfn 0 -phase 99

in order to forecast without re-estimating the model. However, when I check the newly generated ss.par file, I see that the recdev value has changed slightly and is now 0.001 instead of the 0 I had entered.

Do you know why this happens?
Is there a way to prevent this small change and ensure the value remains exactly as specified?

Thanks in advance for your help.

Best regards,

Marta Cousido

Marta Cousido

unread,
Apr 24, 2025, 6:53:25 AMApr 24
to SS3 - Forum

Just a quick follow-up to my previous message:

I’ve noticed that if, instead of using the ss -maxfn 0 -phase 99 command, I set the line in starter.ss to:


0 # Turn off estimation for parameters entering after this phase

then the recruitment deviation in the terminal year does stay exactly at zero, as intended.

However, the issue is that the bias adjustment is still being applied, and as a result, the final recruitment estimate differs slightly from the expected value from the stock-recruitment curve.

Thanks again!

Jason Cope

unread,
Apr 24, 2025, 1:13:33 PMApr 24
to SS3 - Forum
Hi Marta,

If you are using the rec devs in the par file (you could also activate them in the control ss_new file as another option), you can turn off the 13 advanced recruitment options, and thus no longer activate the bias adjustment. Does that fix the issue?
I would think you would not need those advanced options on if you are inputting the rev devs as a vector, and hopefully that takes away any bias adjustment going on.

-Jason

Richard Methot - NOAA Federal

unread,
Apr 24, 2025, 1:26:14 PMApr 24
to SS3 - Forum
Another thing to be aware of is the zero-centering of the recdevs if you use recdev type 1.  If you change one value in the par file, then ADMB will adjust all of them to return to the sum being 0.0.  So, only use recdev type 2 if you are manipulating the devs outside of SS3.  We generally see recdev type 2 as being a more robust option.
Rick

Marta Cousido

unread,
Apr 25, 2025, 3:40:22 AMApr 25
to Richard Methot - NOAA Federal, SS3 - Forum

Dear SS experts,

Thank you very much for your response, Jason and Rick.

I'd like to provide a bit more detail on the issue, as I realize my previous message may have been too incomplete.

In the ICES Assessment Working Group, we run the SS model and, once that is done, we modify the forecast file to generate the projections accordingly. At this stage, the model is not re-estimated — we simply run the model again with 0 # Turn off estimation for parameters entering after this phase so that the forecasts come from the SS model we presented to the group, without any changes to the parameter estimates.

The issue arises because we feel that the 2024 recruitment (the terminal year of data) may not be well estimated. So before generating new model files with an updated forecast file, we would like to override the 2024 recruitment value and set it equal to the SR prediction (i.e., dev = 0).

What we’d like to do is: without changing anything else in the model or re-estimating, set the 2024 recruitment deviation to 0 and also turn off the bias adjustment for 2024. I was able to set the recdev to 0 in the ss.par, but the bias adjustment is still being applied.

Turning off the 13 advanced recruitment options in the control file would affect all years — or even if adjusted just for 2024, it would require re-running the model, which we want to avoid, as that would likely alter more model outputs than just setting recdev_2024 = biasadj_2024 = 0.

Regarding the type 1 and type 2 recruitment options: we currently use type 1, but changing this during the group is not possible, as it’s a benchmark decision.

I hope this clarifies the issue better than in my previous message.
Is there a way to achieve what we need — keeping recdev_2024 = 0 and biasadj_2024 = 0 — without re-estimating the model?

Thank you again for your help!

Best regards,
Marta



--
You received this message because you are subscribed to the Google Groups "SS3 - Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ss3-forum+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ss3-forum/c4b3e98c-18f6-4bda-9fb5-9e7a9dc37591n%40googlegroups.com.

Marta Cousido

unread,
Apr 25, 2025, 8:24:40 AMApr 25
to SS3 - Forum

Dear SS experts,

Just a quick note to say you can disregard my previous message — I’ve already figured out the solution.

Thanks so much for your help!

Best,

Marta Cousido

unread,
Apr 25, 2025, 3:10:25 PMApr 25
to SS3 - Forum
Hi again :)

This message is to follow up on the previous questions.  

Before getting into the solution that mentioned in the previous message, I’d like to clarify that our issue mainly arises because we want to avoid running the model again (i.e., we don’t want to re-estimate the model parameters). One of the reasons for this is that our model has convergence issues, so to confirm where the minimum likelihood is, we need to apply jittering. Therefore, we are looking for a solution that doesn’t require re-estimating all the parameters.

Then for solving the problem, I fixed the recruitment deviation for 2024 at 0 in the ss.par file, and to avoid the bias adjustment being applied to that year, I modified the control file and set #_end_yr_for_ramp_in_MPD to 2024 instead of 2025 (which was the previous value I had).

Then, I ran the model with 0 in the line # Turn off estimation for parameters entering after this phase in the starter.ss file.   With this setup, I was able to get a recruitment estimate for 2024 equal to the stock-recruitment curve, without re-estimating the remaining model parameters—which was exactly what I needed for the projections.

After that I realized that for computing some measures I need estimates of variability for the model hence I need to run with the Hessian. To get the Hessian without re-estimating the model, I used the command:


ss -maxfn 0 -phase 99

What surprised me is that the model didn’t invert the Hessian. I wasn’t expecting that, because before the changes to the control file and ss.par (fixing the 2024 rec dev at 0), it was providing the Hessian. But after those changes, when I run the same command again, I no longer get it.

Am I doing something wrong? Or is there a known reason why this might happen?

Another issue I noticed when running the model this way to obtain the Hessian is that, as I mentioned in an earlier message, the recruitment deviation for 2024—which I had fixed at 0 in the ss.par file—can end up being slightly different from zero after executing -maxfn 0 -phase 99. The way I had previously managed to keep the rec dev for 2024 exactly at zero was by setting 0 in the line Turn off estimation for parameters entering after this phase in the starter.ss file and run the model but  this approach isn’t suitable when a Hessian is needed. Given this, could it be that the approach of fixing the 2024 recruitment deviation to zero in the ss.par file and adjusting the final year's bias in the control file might not work if we need to run the model with the Hessian? Is this solution only viable if we don't need to obtain the Hessian?

Thanks a lot again for your help — and apologies for all the questions! We're currently working on an ICES assessment group, and some of these situations are new to us, so your support is very much appreciated.

Thank you so much,
Marta

Marta Cousido

unread,
Apr 29, 2025, 8:29:46 AMApr 29
to SS3 - Forum

The issue we observed—where running the model with -maxfn 0 -phase 99 after setting the 2024 recruitment deviation to 0 in ss.par resulted in a rec dev for 2024 different than 0—was due to the recruitment deviation rescaling that ADMB performs when reading the ss.par file.

To address this, I changed the method to recdev_approach = 2, which allows us to use ss -maxfn 0 -phase 99 without the rescaling of recdevs in ss.par. Thanks to Rick for pointing this out!

The only remaining issue is with the Hessian. Before making any changes to the control file and ss.par (i.e., before fixing the 2024 rec dev at 0), the model was successfully producing the Hessian using ss -maxfn 0 -phase 99. However, after those changes, running the same command no longer yields a Hessian.

I assume this is because obtaining the Hessian under these conditions isn't possible unless a full model estimation is performed.

A separate but related issue is that even when I set 2023 as the final year for main recruitment deviations in the control file and run a full model estimation, a recruitment deviation value for 2024 still appears in the report, labeled as Late_RecrDev_2024. I’ve reviewed the manual but haven’t found a way to remove that late rec dev.

Thank you so much for your help!

Ian Taylor - NOAA Federal

unread,
Apr 29, 2025, 10:13:52 AMApr 29
to Marta Cousido, SS3 - Forum
Hi Marta,
Good to hear you were able to resolve the summing-to-zero issue.

In general, you can only get a Hessian if you are at the MLE for all the estimated parameters. Since there's no way to fix an individual recruitment deviation parameter, you are stuck with just making the change and not doing any estimation as you've done, but that means there's an estimated parameter which is not at its MLE and inverting the Hessian will presumably fail.

One possible solution to the Hessian issue lies in the separate issue you raise. There are 3 separate phases settings for recdevs, one for INIT/EARLY, one for MAIN, and one for LATE/FORE recdevs. The phase for the late and forecast recdevs in the control file looks like "0 #_forecast_recruitment phase (incl. late recr) (0 value resets to maxphase+1)". I just confirmed that if you set that phase to negative, then you could change the values of the late or forecast recdevs in the .par file (they appear under "Fcast_recruitments") and still get an inverted Hessian.

Lastly, I'll note that immediately after the late/forecast phase setting is an input "1 #_lambda for Fcast_recr_like occurring before endyr+1" which can be used to increase the penalty on the recdevs at the end of the model deviating from zero. I don't think this option has been widely used, so I don't have any guidance on how it impacts the model results.
-Ian



Marta Cousido

unread,
May 12, 2025, 9:12:29 AMMay 12
to SS3 - Forum

Hi Ian,

Thank you very much for your response.

I have run the model with  a negative value in "0 #_forecast_recruitment phase (incl. late recr) (0 value resets to maxphase+1)", and now the  Late_RecrDev_2024 is at zero as we need. 

Thanks again for your help!

Best regards,

Reply all
Reply to author
Forward
0 new messages