Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: serodynamics
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9044
Version: 0.0.0.9045
Authors@R: c(
person("Peter", "Teunis", , "p.teunis@emory.edu", role = c("aut", "cph"),
comment = "Author of the method and original code."),
Expand Down
12 changes: 7 additions & 5 deletions inst/extdata/model.jags
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ model {
}

# these are random effects
y0[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,1])
y1[subj,cur_antigen_iso] <- y0[subj,cur_antigen_iso] + exp(par[subj,cur_antigen_iso,2]) # par[,,2] must be log(y1-y0)
t1[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,3])
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):
Copy link

Copilot AI Jan 5, 2026

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)"

Suggested change
# par[,,2] is log(y1-y0):
# par[,,2] represents log(change in y from baseline (y0) to peak (y1)):

Copilot uses AI. Check for mistakes.
change_y[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,2])
y1[subj,cur_antigen_iso] <- y0[subj,cur_antigen_iso] + change_y[subj,cur_antigen_iso]
t1[subj,cur_antigen_iso] <- exp(par[subj,cur_antigen_iso,3])
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

# `n_params` is the number of model parameters; y0, y1, t1, alpha (aka nu), and r
# this is the prior distribution
Expand Down