Skip to content

Comments

191 spawner recruit rebased#640

Merged
Rick-Methot-NOAA merged 58 commits intomainfrom
191-spawner-recruit-rebased
Jul 8, 2025
Merged

191 spawner recruit rebased#640
Rick-Methot-NOAA merged 58 commits intomainfrom
191-spawner-recruit-rebased

Conversation

@Rick-Methot-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA Rick-Methot-NOAA commented Nov 6, 2024

continuation of PR #442 after updating from 3.30.23 main on 11/06/2024
This implements SRR function 10 for Bev-Holt with alpha, beta
also adds two new controls to give user more control of how time-varying biology affects benchmark and control rule implementation.

Resolves issue #191, #341, #625

See the checkboxes at top of issue #191 for the list of major changes with this branch.

@iantaylor-NOAA
Copy link
Contributor

@e-perl-NOAA, do you know why most of the github actions for this Pull Request were all skipped? I was able to compile on my computer for testing, it would be helpful to know which tests are passing.

@Rick-Methot-NOAA
Copy link
Collaborator Author

Ian, I suspect it is because it is still a draft PR

@e-perl-NOAA
Copy link
Collaborator

It is because it's a draft PR, once it's converted from a draft PR they will all run.

@Rick-Methot-NOAA
Copy link
Collaborator Author

OK. I concur on the variance problem with lorenzen.

@Rick-Methot-NOAA
Copy link
Collaborator Author

When I turn off dynamic Bzero in the lorenzen control file, then the derived variances work

@e-perl-NOAA
Copy link
Collaborator

Okay, after making the change to the lorenzen to not include dynamic B0, the values that have changed are the following:

quantity value ref_value diff perc_change ratio mod_name
Sum_recdevs_like 4.14E-12 4.47E-09 -0.000000004 -99.9074 0.00093 growth_timevary
Forecast_Recruitment_like 5.07E-24 5.91E-18 -5.91E-18 -99.9999 0.0000009 growth_timevary
Parm_priors_like 0.2915 0.2915 2.00E-06 0.0007 1.00001 growth_timevary
maxgrad 0.0000 0.0001 -0.000048050 -51.8468 0.48153 growth_timevary
SSB_unfished_se 600018.0000 329321.0000 270697.000000000 82.1985 1.82199 growth_timevary
Sum_recdevs_like -4.89E-16 1.49E-16 -6.38E-16 -427.9070 -3.27907 platoons
maxgrad 0.0001 0.0001 0.000002858 3.4426 1.03443 platoons
SSB_unfished_se 4775.4400 5714.0600 -938.620000000 -16.4265 0.83574 platoons
SSB_unfished_se 1408.6300 1392.2500 16.380000000 1.1765 1.01177 Simple
SSB_unfished_se 1408.3500 1388.7700 19.580000000 1.4099 1.01410 Simple_NoCPUE
SSB_unfished_se 1479.7300 1461.7000 18.030000000 1.2335 1.01233 Simple_with_Discard

The growth_timevary we expect, the 3 simple ones have very small changes so I think we are okay there, but the platoons one still has some differences that we don't understand yet. @Rick-Methot-NOAA, could you dig into that model to see if you can figure out why we are seeing these differences?

@Rick-Methot-NOAA
Copy link
Collaborator Author

I suspect that the changes to SSB_unfished_se are because the calculation of that quantity now can involves a call to Equ_SpawnRecr_Result function, rather than the simpler approach. But the simpler existing approach is still used in compatibility mode, so this might require a deep dive to understand it.

@e-perl-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA Would you like to proceed with the pre-release while you do that deep dive into that?

@Rick-Methot-NOAA
Copy link
Collaborator Author

Probably yes with the pre-release; that will help find other differences.
Please send me the ss_summary.sso file from the simple model run in the gha. Seems different from my local.

@e-perl-NOAA
Copy link
Collaborator

That can be found in this zip file that is an artifact of the GHA.

@Rick-Methot-NOAA
Copy link
Collaborator Author

The simple model in the gha produces a different result than what I get locally.
gha simple is using recdev option 1 (zero-centered), but it produces a sum_recdevs of 1.37009. How can that happen?
The compare picture attached here has the gha run on the left, my local run in center, and an old run using 3.30.20 on the right.
image

@e-perl-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA, did you add the compatibility lines in the simple model or did you run it just as is?

@iantaylor-NOAA
Copy link
Contributor

I think there must be 2 versions of Simple floating around. The version in the ss3-test-model repo is at https://github.com/nmfs-ost/ss3-test-models/blob/main/models/Simple/. This has do_recdev = 2 which was changed last year so that it could be used with MCMC: nmfs-ost/ss3-test-models#62.

When run I run that model with yesterday's executable from this branch, I get the same results as the file in the github action that @e-perl-NOAA just attached, which has
SSB_Virgin 49766.2 1408.63
SSB_unfished 49766.2 1408.63

However, these don't match the 3.30.23.2 version on github linked above, which is the source of the "ref_value" in the table above and has different uncertainty for SSB_unfished:
SSB_Virgin 49766.2 1408.63
SSB_unfished 49766.2 1392.25

@Rick-Methot-NOAA
Copy link
Collaborator Author

Wow. When I pull from the main branch of test-models I still get the simple model from Feb 2024 with do_recdev=1

@e-perl-NOAA
Copy link
Collaborator

e-perl-NOAA commented Jul 1, 2025

@Rick-Methot-NOAA, there are a couple of things that might explain this:

  1. Your git is still somehow connected to the repo when it was still nmfs-stock-synthesis/test-models rather than nmfs-ost/ss3-test-models. You can figure this out by doing git remote -v, and if it is, you can reset it using git remote set-url origin <NEW_GIT_URL_HERE>
  2. Somehow things are out of sync despite the pull, try fetching first: git fetch origin then git pull origin main

If that doesn't work, it might be worth deleting the repo locally and redownloading from GitHub.

@Rick-Methot-NOAA
Copy link
Collaborator Author

figured it out. I had two folders on my local machine. The one I was looking in was indeed linked to the old repo. Now deleted.

@Rick-Methot-NOAA
Copy link
Collaborator Author

Rick-Methot-NOAA commented Jul 1, 2025

I need to work on the internal quantities of benchmark a bit more. look at these se values for thetelling clue:
SSB_Virgin 49766.2 1408.63
SSB_Initial 49766.2 1408.63
SSB_1971 49766.2 1408.63
SSB_unfished 49766.2 1408.63
SSB_unfished_again 49766.2 1392.25
SSB_virgin_again 49766.2 1408.63

SSB_unfished_again is set to SSB_unf, so differs in the number of calculations leading to its value.

Still working on validating the logic in SS_benchfore beginning around lines 760; may not get it done before next week

@e-perl-NOAA
Copy link
Collaborator

e-perl-NOAA commented Jul 2, 2025

Okay, I know I asked yesterday, but asking again in case things have changed - would you like to go ahead with the pre-release or wait until next week when you are able to resolve benchmark quantities @Rick-Methot-NOAA ?

@Rick-Methot-NOAA
Copy link
Collaborator Author

let's wait until next week. After I make some changes I want to run back through the tests that were included in the presentation

@e-perl-NOAA
Copy link
Collaborator

Here are the new difference values for your recent change @Rick-Methot-NOAA:

quantity value ref_value diff perc_change ratio mod_name
Sum_recdevs_like 4.14E-12 4.47E-09 -4.46E-09 -9.99E+01 9.26E-04 growth_timevary
Forecast_Recruitment_like 5.07E-24 5.91E-18 -5.91E-18 -1.00E+02 8.58E-07 growth_timevary
maxgrad 4.46E-05 9.27E-05 -4.80E-05 -5.18E+01 4.82E-01 growth_timevary
Catch_like 5.78E-13 5.78E-13 1.00E-18 1.73E-04 1.000002 platoons
Sum_recdevs_like -4.89E-16 1.49E-16 -6.38E-16 -4.28E+02 -3.279074 platoons
maxgrad 8.59E-05 8.30E-05 2.86E-06 3.44E+00 1.034426 platoons
SSB_unfished_se 4.78E+03 5.71E+03 -9.39E+02 -1.64E+01 0.835735 platoons
ForeCatch_2004_se 1.58E+03 1.58E+03 8.18E+00 5.19E-01 1.005188 platoons
SSB_unfished_se 1.41E+03 1.39E+03 16.38 1.1765128 1.011765 Simple
ForeCatch_2011_se 4.81E+02 4.81E+02 -0.109 -0.0226692 0.999773 Simple
SSB_unfished_se 1.41E+03 1.39E+03 19.58 1.40988069 1.014099 Simple_NoCPUE
ForeCatch_2011_se 1.16E+03 1.16E+03 -0.1 -0.0086327 0.999914 Simple_NoCPUE
ForeCatch_2011_se 5.07E+02 5.07E+02 -0.089 -0.0175646 0.999824 Simple_with_Discard

@Rick-Methot-NOAA
Copy link
Collaborator Author

These small changes all look to be within reasonable tolerances. I think we can proceed to the pre-release this week. I'll get the release message prepared.

@e-perl-NOAA
Copy link
Collaborator

@Rick-Methot-NOAA Please go ahead and merge whenever you are ready. I just pushed the test-models repo branch to main so the one change made was to have the github actions use main again.

@Rick-Methot-NOAA Rick-Methot-NOAA merged commit 1cfbffa into main Jul 8, 2025
7 of 8 checks passed
@Rick-Methot-NOAA Rick-Methot-NOAA deleted the 191-spawner-recruit-rebased branch July 8, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment