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

improve table_decision() #167

Open
3 of 4 tasks
iantaylor-NOAA opened this issue Jul 21, 2021 · 9 comments
Open
3 of 4 tasks

improve table_decision() #167

iantaylor-NOAA opened this issue Jul 21, 2021 · 9 comments

Comments

@iantaylor-NOAA
Copy link
Collaborator

iantaylor-NOAA commented Jul 21, 2021

The table_decision() function worked really well for quickly combining output from multiple models during the lingcod STAR.

However, there are a few changes that I think would be useful:

  • use the catch from the middle state of nature rather than the first catch column since the low state of nature may not have enough fish to remove the full catch
  • compare catch from the low and high state to the middle state within a row and provide a message or warning saying which years from which models differ by more than some cutoff (I would suggest 1%, but it could be a new input rather than hardwired). I think it would be useful to put the result into a table caption (e.g. "The full catch could not be removed from the low state of nature for the years 2027-2032"). It's also easy to accidentally mix up models such that the catches differ because they are specified differently rather than because the catch can't be removed.

I'm not sure how best to make these changes elegantly within the existing function. Also, it would be nice to not break the flexibility in the number of columns (models) within each row.

Also

Added 1 Dec 2021:

  • revise table_decision() to italicize only the state of nature for which catch is limiting, rather than all states of nature.
@kellijohnson-NOAA
Copy link
Collaborator

I will see what I can do, I think @chantelwetzel-noaa used an asterisk when the full catch couldn't be taken.

@iantaylor-NOAA
Copy link
Collaborator Author

I'd be happy with an asterisk.

@chantelwetzel-noaa
Copy link

I had the issues where full removals could not be taken from the final years of the projection in the low state of nature. In my decision table on page xx I highlighted these values by italics and provided a description in the caption. However, in hindsight I think a better approach would be via an asterisk which then could be added as a footnote to the table (or in the table caption).

@kellijohnson-NOAA
Copy link
Collaborator

Used max catch for each year, if it doesn't equal for a given catch stream then the SSB and depletion are italicized. I didn't have an example though to make sure it works. Just shooting off the hip.

We can change to an asterisk later with footnote, but wanted to get something by today.

Also, removed a lot of the coloration code b/c I had to add it to the conditional formatting that italicizes the column. This makes the colors work for no matter how many models are provided.

Done in e1df08c

@iantaylor-NOAA
Copy link
Collaborator Author

The new table looked great but was creating duplicate rows for reasons that I couldn't figure out so I went back to the old version and set the catch column to match the middle (base) model to produce something for #166. The improvements will be useful but can wait until later.

@iantaylor-NOAA
Copy link
Collaborator Author

@kellijohnson-NOAA, the models for decision table are on Google Drive (sens numbers starting with 600).
Table function can be tested by downloaded those files for north or south and running these lines (or modifications of them): https://github.com/iantaylor-NOAA/Lingcod_2021/blob/main/models/model_decision_tables.R#L87-L115

@kellijohnson-NOAA
Copy link
Collaborator

Thanks @iantaylor-NOAA for giving me the model numbers, super helpful. I was able to figure out what I was doing wrong and have committed changes to table_decision with 7969544

@iantaylor-NOAA
Copy link
Collaborator Author

Changes by @kellijohnson-NOAA back in August (507cf37), combined with minor edit to caption in commit 969a5c9 resolve this issue.

@iantaylor-NOAA iantaylor-NOAA added this to the nextassessment milestone Dec 1, 2021
@iantaylor-NOAA iantaylor-NOAA removed the status: enhancement New feature or request label Dec 1, 2021
@iantaylor-NOAA
Copy link
Collaborator Author

  • revise table_decision() to italicize only the state of nature for which catch is limiting, rather than all states of nature.

As a short-term fix for the final 2021 document, we will edit the .tex files, but a long-term fix can be made to the function itself in the future. Adding to nextassessment benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants