-
Notifications
You must be signed in to change notification settings - Fork 0
clarify jags code #144
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
base: main
Are you sure you want to change the base?
clarify jags code #144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR improves the readability and maintainability of the JAGS model code by refactoring the calculation of y1 to use an intermediate variable and moving inline comments to separate lines for better clarity.
- Extracted the
change_yintermediate variable from the inliney1calculation - Moved the explanatory comment about
par[,,2]to a separate line - Improved code alignment for better readability
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| inst/extdata/model.jags | Refactored y1 calculation by introducing change_y intermediate variable and improved comment placement |
| DESCRIPTION | Version bump from 0.0.0.9044 to 0.0.0.9045 to reflect the code clarification |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| alpha[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,4]) # `nu` in the paper | ||
| shape[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,5]) + 1 # `r` in the paper | ||
| y0[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,1]) | ||
| # par[,,2] is log(y1-y0): |
Copilot
AI
Jan 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment "par[,,2] is log(y1-y0)" is technically imprecise. Based on the code, par[,,2] represents log(y1-y0), and when exponentiated it gives change_y = y1 - y0.
Consider revising the comment to be more explicit, such as: "par[,,2] represents log(change in y from baseline to peak)"
| # par[,,2] is log(y1-y0): | |
| # par[,,2] represents log(change in y from baseline (y0) to peak (y1)): |
Refactors
y1calculation in JAGS code by introducingchange_yintermediate variable.Shouldn't affect numerical results, as shown by the
run_mod()snapshot tests.