Conversation
There was a problem hiding this comment.
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. |
| 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): |
There was a problem hiding this comment.
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.