Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

facilitate making profile and retro plots after manual changes to the models? #25

Open
iantaylor-NOAA opened this issue Jun 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@iantaylor-NOAA
Copy link
Contributor

This is outside the scope of the PR #24, but I thought I'd post now in case it's worth thinking about for the future.

The petrale profiles have been a mess. The parameter panel below on the left is an example of the poor convergence (panels on the right are after sorting things out). I had issues whether starting from the .par file or the control.ss_new, even with the changes in the profile_control branch.

In the end, rather than rely on the jittering in rerun_profile_vals() (which may have been pretty slow and also unreliable for petrale), I chose to call r4ss::profile() directly, then re-run individual models with as many tweaks as needed to starting values to get convergence, and finally run nwfscDiag::get_summary() and nwfscDiag::profile_plot() to make the plots. This process would have been slightly easier if the nwfscDiag::profile_wrapper() function separated the parts that run the profile from the parts that get the output and make plots. Separating those two things could also be used to remove the redundant parts of profile_wrapper() and rerun_profile_vals(). That is, it would be nice to be able to run profile_wrapper() or even run_diagnostics() with some kind of argument like skipruns = TRUE which would cause it to repeat the process of loading the model output and making the plots, but skip everything related to deleting model files, running models, and renaming model output.

I made a change like this to the retro_wrapper() function (where it was easier to implement) in the "skipruns" branch to help with making a change to an individual nonconverged retrospective model for petrale.

For the record, the petrale code to do this stuff is in https://github.com/pfmc-assessments/petrale/blob/main/Rscripts/profile_notes.R.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant