Skip to content

Model description and upcoming additions#88

Open
Kwan-Jenny wants to merge 41 commits into
mainfrom
beamer
Open

Model description and upcoming additions#88
Kwan-Jenny wants to merge 41 commits into
mainfrom
beamer

Conversation

@Kwan-Jenny
Copy link
Copy Markdown
Collaborator

This pull request adds the finalized Beamer presentation materials for the April 14th meeting, including:

  • Beamer_Antibody_Kinetics.qmd: Full 32-slide presentation in Quarto Beamer format
  • Beamer_Antibody_Kinetics.pdf: Compiled version for presentation
  • Slides incorporate feedback from Dr. Morrison on the antibody kinetics model in Chapter 2
  • Covers model equations, parameter interpretations, hierarchical prior structures, and proposed correlation modeling across biomarkers

Please let me know if you want me to change anything in here.

@Kwan-Jenny Kwan-Jenny requested a review from d-morrison April 15, 2025 00:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

@d-morrison d-morrison changed the title 04.14.25 Meeting Material: Beamer Presentation (Chapter 2 Model Revisions) Model description and upcoming additions Apr 15, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 15, 2025

📖 https://ucd-serg.github.io/serodynamics/preview/pr88
Preview documentation for this PR (at commit b18c735)

Copy link
Copy Markdown
Member

@d-morrison d-morrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far! See comments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't track the pdf version

Comment thread vignettes/Beamer_Antibody_Kinetics.tex Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
Comment thread vignettes/Beamer_Antibody_Kinetics.qmd Outdated
@Kwan-Jenny Kwan-Jenny requested a review from d-morrison April 29, 2025 23:47
@Kwan-Jenny Kwan-Jenny removed the request for review from d-morrison May 7, 2025 01:07
@Kwan-Jenny Kwan-Jenny requested a review from sschildhauer May 16, 2025 01:04
@Kwan-Jenny Kwan-Jenny requested review from sschildhauer and removed request for sschildhauer May 22, 2025 23:27
@Kwan-Jenny
Copy link
Copy Markdown
Collaborator Author

image

Currently, there are three .qmd files in the articles folder, but Antibody_Kinetics.qmd is the most up-to-date version. Therefore, only Antibody_Kinetics.qmd needs to be reviewed. However, I am unsure whether I should delete the other two .qmd files. @d-morrison, should I delete the other two and keep only this one?

Copy link
Copy Markdown
Collaborator

@sschildhauer sschildhauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great Kwan! Just a few small clarifications. After reviewing you can re request from me and I will try to review in a more timely manner.

@@ -0,0 +1,250 @@
---
title: "Hierarchical Bayesian Model"
author: "Our Study Group"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
author: "Our Study Group"
author: "Kwan Ho Lee, UC Davis SeroEpidemiology Research Group"


## Big Picture: What Are We Modeling?

We are modeling **how antibody levels change over time** in response to infection, using data from multiple individuals and multiple **biomarkers** (10 antigen-isotype combinations, so ( j = 1, 2, ..., 10 )).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We are modeling **how antibody levels change over time** in response to infection, using data from multiple individuals and multiple **biomarkers** (10 antigen-isotype combinations, so ( j = 1, 2, ..., 10 )).
We are modeling **how antibody levels change over time** in response to infection for different antigen-isotype (biomarker) combinations (ex. anti-LPS IgG), using longitudinal serologic data from multiple individuals (10 antigen-isotype combinations, so ( j = 1, 2, ..., 10 )).


## Big Picture: What Are We Modeling?

We are modeling **how antibody levels change over time** in response to infection, using data from multiple individuals and multiple **biomarkers** (10 antigen-isotype combinations, so ( j = 1, 2, ..., 10 )).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this 10 antigen-isotype combinations? Couldn't it technically be any number of combinations?

We want to:

- Understand the average pattern for each biomarker
- Allow each person’s response to vary
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Allow each person’s response to vary
- Allow each person’s response to vary as a random effect

\end{bmatrix}
$$

These describe the antibody curve for person ( $i$ ) and biomarker ( $j$ ): the starting level, how fast it rises, peaks, and decays.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These describe the antibody curve for person ( $i$ ) and biomarker ( $j$ ): the starting level, how fast it rises, peaks, and decays.
These describe the antibody kinetic curve for each person ( $i$ ) and biomarker ( $j$ ): the baseline antibody level, rate of increase, peaks antibody level, and decay (waning) rate.


Higher $\nu_j$ $\rightarrow$ more informative prior (stronger prior).

Lower $\nu_j$ $\rightarrow$ more weakly informative (broader prior or weaker prior).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Lower $\nu_j$ $\rightarrow$ more weakly informative (broader prior or weaker prior).
Lower $\nu_j$ $\rightarrow$ less informative (broader prior or weaker prior).


The model is built hierarchically across five conceptual levels:

1. **Observed data:** noisy log antibody concentrations from serum samples
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **Observed data:** noisy log antibody concentrations from serum samples
1. **Observed data:** log antibody concentrations from serum samples

The model is built hierarchically across five conceptual levels:

1. **Observed data:** noisy log antibody concentrations from serum samples
2. **Latent individual parameters:** hidden antibody dynamics $\theta_{ij}$ for each subject-biomarker pair
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "hidden" mean here? Does it mean unobserved?


2. **Middle Level**:

- For each person $i$, their parameters:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- For each person $i$, their parameters:
- Each person $i$ has their parameters:


3. **Bottom Level**:

- Their actual observed antibody levels are noisy measurements of predictions from $\theta_{ij}$:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Their actual observed antibody levels are noisy measurements of predictions from $\theta_{ij}$:
- Observed antibody levels are noisy measurements of predictions from $\theta_{ij}$:

@Kwan-Jenny
Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: Kwan-Jenny <68584166+Kwan-Jenny@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 18:13
@Kwan-Jenny Kwan-Jenny review requested due to automatic review settings May 21, 2026 18:13
Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

@copilot resolve the merge conflicts in this pull request

Resolved — I merged origin/main into this PR branch and fixed the conflicts in .gitignore, DESCRIPTION, and NEWS.md in commit 5a1823b.

@Kwan-Jenny
Copy link
Copy Markdown
Collaborator Author

@claude review

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 21, 2026

Claude finished @Kwan-Jenny's task in 2m 23s —— View job


Claude PR Review

  • Read repo structure
  • Examine changed files (git diff origin/main...HEAD)
  • Review vignettes/articles/Antibody_Kinetics.qmd
  • Review vignettes/articles/Beamer_Antibody_Kinetics.qmd
  • Review vignettes/articles/Hierarchical_Bayesian_Model.qmd
  • Check tracked PDF / .tex files against prior review feedback
  • Check .gitignore, NEWS.md, inst/WORDLIST, references.bib
  • Post review feedback

Summary

The presentation/article content has come a long way and the notation cleanup ($\mu_y$, $\mu_b$, $\gamma$, $\rho$, citation system) addresses most of @d-morrison's earlier requests. But several blocking items from the prior reviews are still unresolved, plus a couple of new bugs introduced by recent edits. Notes below in priority order.


Blocking

1. PDFs and .tex files are still being tracked. @d-morrison asked twice not to track these. They are still in the tree:

  • vignettes/Beamer_Antibody_Kinetics.pdf (77 KB)
  • vignettes/articles/Antibody_Kinetics.pdf (79 KB)
  • vignettes/articles/Antibody_Kinetics.tex (33 KB, 985 lines)

The existing .gitignore rules vignettes/*.pdf and vignettes/*.tex only match the top-level vignettes/ directory; nothing covers vignettes/articles/. To fix: git rm the three files and extend the ignore rules, e.g. add:

vignettes/articles/*.pdf
vignettes/articles/*.tex

2. .gitignore contains a broken line introduced in the merge. Line 14 currently reads docsvignettes/*.pdf — that is not a valid path (it matches nothing). It also looks like docs/ was removed but docs (line 18) is still there, so the intent is unclear. Please fix this typo as part of the same edit.

3. PR scope is ambiguous — three .qmd files, only one is current. Per Jenny's own comment, only Antibody_Kinetics.qmd is up to date, yet the PR is adding Beamer_Antibody_Kinetics.qmd and Hierarchical_Bayesian_Model.qmd as new files. If those two are superseded, please delete them from this PR rather than landing three overlapping documents. If they are intentionally kept as separate artifacts (slides vs. article vs. study-group walkthrough), please add a short note in NEWS.md/the article frontmatter clarifying which is which — pkgdown will render all three as separate articles otherwise.

4. Bibliography is incomplete relative to @d-morrison's request. The review asked to summarize Teunis 2016 and 2023 models before introducing the revised model. Neither file does this, and references.bib only contains teunis2016 — there is no teunis2023 entry at all. Either add a Teunis 2023 entry and a summary slide/section, or note explicitly that this will be added in a follow-up.

5. references.bib has no trailing newline — minor, but several tools (and usethis::use_tidy_description) will flag this. Add a final \n.


Math / content bugs

6. Hierarchical_Bayesian_Model.qmd:79 — wrong dimensions for $\Sigma_j$.

$\Sigma_j$ : $j×j$ covariance matrix describing how the parameters co-vary

This is a mathematical error: $\Sigma_j$ is a covariance matrix over the 7 subject-level parameters, so it is $7\times 7$ (not $j\times j$, which would make it $1\times 1$ when $j=1$). Compare with Antibody_Kinetics.qmd:225 and Beamer_Antibody_Kinetics.qmd:308, which both correctly state $\Sigma_j \in \mathbb{R}^{7\times 7}$.

7. Antibody_Kinetics.qmd:133 and :180 — escaped > will not render.

-   For $t \> t_1$: $$

\> is not valid LaTeX/Quarto math; it renders literally. Should be $t > t_1$. The earlier ODE block at line 116 uses the correct form.

8. Antibody_Kinetics.qmd:247 and :416 — stray backslash-escaped underscores break LaTeX.

-   These 5 parameters are **log-transformed** into the latent parameters $\theta\_{ij}$ used for modeling.
1.  $\theta_{ij}$ are the **subject-level latent parameters** (like $y_0, b_0, \mu\_b, \mu\_y, \gamma, \alpha, \rho$).

Inside $...$ the underscores should be plain _, not \_. As written, this renders the literal text \_ instead of subscripting.

9. Beamer_Antibody_Kinetics.qmd:412-427 — old notation leaks through. The "Understanding $\text{vec}(\Theta_i)$" slide still lists the vector entries as $y_0, b_0, \mu_0, \mu_1, c, \alpha, r$ even though every other slide in the deck now uses $\mu_b, \mu_y, \gamma, \alpha, \rho$. Please update so the notation is consistent throughout.

10. Antibody_Kinetics.qmd YAML defines beamer: AND pdf:. That produces two PDFs on render (Beamer slides + an article PDF). Given that the article version is already separately delivered via html: default, the second pdf: block is probably unintended — and it is what makes Antibody_Kinetics.pdf and .tex keep showing up in the working tree. Either drop the pdf: block, or — if you actually want both — at minimum get the resulting files out of git per point (1).


Outstanding from prior reviewers (still applies)

These were requested but not yet addressed:

  • @d-morrison, title suggestion for the article: "Extending the Hierarchical Model for Antibody Kinetics" — the Beamer deck adopted it, but Antibody_Kinetics.qmd:2 still says "Hierarchical Bayesian Modeling of Antibody Kinetics: Extensions and Refinements". Pick one consistently.
  • @sschildhauer on hardcoded 10: still present in Antibody_Kinetics.qmd:39 ("(j = 1, 2, $\dots$, 10)") — generalize to $n$ or state the constraint.
  • @sschildhauer on Antibody_Kinetics.qmd:63 ($\theta$ not present in the equation above): still applies — either reference $\theta_{ij}$ explicitly in eq-1 or remove the bullet.
  • @sschildhauer on Antibody_Kinetics.qmd:111: still no sentence explaining how the ODE system relates to the closed-form solutions that follow.
  • @sschildhauer on Antibody_Kinetics.qmd:379 ("hidden"): the new wording at line 379 still uses "hidden antibody dynamics" — replace with "unobserved/latent" for clarity.

I'd suggest going through @sschildhauer's review systematically and either applying the suggestion-block edits or replying inline with the reasoning where you disagree.


Smaller nits

  • Beamer_Antibody_Kinetics.qmd:22Dr.Aiemjoy is missing a space (Dr. Aiemjoy).
  • Hierarchical_Bayesian_Model.qmd:3 — author is "Our Study Group". If this slide deck is staying in the PR, please set a real author (or remove the file per point 3).
  • inst/WORDLIST contains a number of duplicate entries (biomarker, biomarkers, isotype, isotypes, mcmc, nmc, vec, hyperprior, Teunis, hyp). spelling::update_wordlist() will de-duplicate and sort it for you.
  • inst/WORDLIST also adds plain math/LaTeX command names (bmatrix, boldsymbol, cdot, cdots, dt, dy, frac, ge, le, leq, mathbb, mathcal, mathrm, otimes, rightarrow, et, th, cd). These suggest the spellchecker is being run on the rendered output and picking up TeX tokens; it might be cleaner to exclude the .qmd/rendered HTML from spellcheck rather than allowlisting every macro name.
  • NEWS.md:50 — entry currently reads "Added Beamer presentation files (Beamer_Antibody_Kinetics.qmd, .pdf) (Model description and upcoming additions #88)". If you stop tracking the .pdf per point 1 (and if you keep Antibody_Kinetics.qmd as the canonical doc per point 3), update this line to match what the PR actually ships.

Things that look good

  • Notation harmonization to $\mu_y, \mu_b, \gamma, \rho$ across files.
  • [@teunis2016] Quarto citation usage in both Antibody_Kinetics.qmd and Beamer_Antibody_Kinetics.qmd.
  • Adding html: default so pkgdown picks these up as articles (per @d-morrison's earlier comment).
  • Cross-references between equations and model.jags line ranges in Antibody_Kinetics.qmd are very helpful for a reader trying to map math → code.

I'm posting this as review feedback only — I have not made any changes to the branch. Happy to apply a subset of these if you'd like; just reply with which ones (e.g. "untrack the PDFs and .tex, fix the .gitignore typo, and fix items 6–9").
• Branch: beamer

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants