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

[Refactor]: Define recruitment_deviations in log space. #402

Closed
1 task done
nathanvaughan-NOAA opened this issue Jul 6, 2023 · 4 comments
Closed
1 task done

[Refactor]: Define recruitment_deviations in log space. #402

nathanvaughan-NOAA opened this issue Jul 6, 2023 · 4 comments
Labels
kind: refactor Restructure code to improve the implementation of FIMS P2 mid-level priority
Milestone

Comments

@nathanvaughan-NOAA
Copy link
Contributor

nathanvaughan-NOAA commented Jul 6, 2023

Refactor request

recruitment_deviations are currently defined as proportions of expected recruitment and then log transformed when the nll is calculated. These should maybe be defined in log space.

Discussion from pull request review.
@ChristineStawitz-NOAA
question: we're not clear - should recruitment_deviations be entered in log space rather than being logged only within the likelihood?

@timjmiller
yeah, this looks wrong unless "recruit_deviations" are ratios of recruitment from one time step to the next.

@Andrea-Havron-NOAA
recruit deviations are in linear space when input into the model and when used in CalculateRecruitment. If we update rec devs to be in logspace, we will need to update code in these two locations. I personally find it hard to keep track of what is supposed to be in log versus linear space and would prefer renaming recruitment_deviations to log_recruitment_deviations or some variety of logR if we want to convert this to log space.

ChristineStawitz-NOAA reacted with thumbs up emoji

@iantaylor-NOAA
I think "deviations", either in variable names or plain language, should refer to values that are distributed on either side of 0. At least I would find that much less confusing. If it's important to maintain non-log values for annual recruitment values, I would call them something like recruitment_scalars or recruitment_multipliers.

Expected behavior

Defining recruitment deviations in log space would be clearer to users.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nathanvaughan-NOAA nathanvaughan-NOAA added status: triage_needed This is not approved for this milestone, do not work on it yet kind: refactor Restructure code to improve the implementation of FIMS labels Jul 6, 2023
@nathanvaughan-NOAA nathanvaughan-NOAA changed the title [Refactor]: [Refactor]: Define recruitment_deviations in log space. Jul 6, 2023
@nathanvaughan-NOAA nathanvaughan-NOAA added this to the MQ milestone Jul 6, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA added status: needs discussion Dialogue is needed before a decision can be made. and removed status: triage_needed This is not approved for this milestone, do not work on it yet labels Jul 11, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this to Ready for Development in MQ Jul 12, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Ready for Development to Needs Discussion in MQ Jul 12, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA added the P2 mid-level priority label Jul 18, 2023
@Cole-Monnahan-NOAA
Copy link
Contributor

I agree to have them defined in log space. Don't we need this eventually when we treat them as random effects? I don't think we should apply the Laplace approximation in the natural space. It seems like any random effects should always been parameterized this way. I also agree with the interpretation of "deviation" and that a consistent naming convention would be helpful.

@Andrea-Havron-NOAA
Copy link
Collaborator

@Cole-Monnahan-NOAA, good point about defining them in log space to be consistent with random effects parameterization.

@Andrea-Havron-NOAA
Copy link
Collaborator

Linking issue #364 as this change will resolve the constrain deviations error mentioned in the conversation

@Andrea-Havron-NOAA Andrea-Havron-NOAA added the status: triage_needed This is not approved for this milestone, do not work on it yet label Aug 2, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA removed status: triage_needed This is not approved for this milestone, do not work on it yet status: needs discussion Dialogue is needed before a decision can be made. labels Sep 5, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Needs Discussion to Ready for Development in MQ Sep 5, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from Ready for Development to In Progress in MQ Oct 19, 2023
@Andrea-Havron-NOAA Andrea-Havron-NOAA linked a pull request Oct 26, 2023 that will close this issue
1 task
@Andrea-Havron-NOAA Andrea-Havron-NOAA moved this from In Progress to Under Review in MQ Oct 31, 2023
@github-project-automation github-project-automation bot moved this from Under Review to Done in MQ Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: refactor Restructure code to improve the implementation of FIMS P2 mid-level priority
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants