Skip to content

Commit 6ee0b56

Browse files
committed
# Revision (notation)
1 parent ab16eb6 commit 6ee0b56

File tree

1 file changed

+93
-64
lines changed

1 file changed

+93
-64
lines changed

vignettes/articles/chapter2_correlated_biomarkers.qmd

Lines changed: 93 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Extending the Hierarchical Model for Antibody Kinetics"
2+
title: "Modeling Correlation in Antibody Kinetics: A Hierarchical Bayesian Approach"
33
author: "Kwan Ho Lee"
44
institute: "UC Davis"
55
date: today
@@ -19,11 +19,12 @@ env:
1919

2020
## Overview
2121

22-
- Incorporates feedback from Dr. Morrison and Dr.Aiemjoy
23-
- Focus exclusively on [@teunis2016] model
24-
- Clarifies model dynamics: growth, clearance, decay
25-
- Uses updated parameter notation: $\mu_y$, $\mu_b$, $\gamma$, $\alpha$, $\rho$
26-
- Assumes block-diagonal covariance structure across biomarkers
22+
- Incorporates feedback from Dr. Morrison and Dr. Aiemjoy\
23+
- Builds on [@teunis2016] framework for antibody kinetics\
24+
- Focus on covariance structure: parameter covariance within each biomarker ($\Sigma_{P,j}$, 5×5 per biomarker) and biomarker covariance across $j$ ($\Sigma_B$, across biomarkers)\
25+
- Uses updated parameterization: $\log(y_0)$, $\log(y_1 - y_0)$, $\log(t_1)$, $\log(\alpha)$, $\log(\rho-1)$\
26+
- Current stage: block-diagonal covariance (independent biomarkers)\
27+
- Planned extension: full $\Sigma_B$ to capture correlation between biomarkers
2728

2829
------------------------------------------------------------------------
2930

@@ -138,7 +139,7 @@ $$ {#eq-y1}
138139
## Model Comparison: [@teunis2016] vs serodynamics
139140
140141
| Component | [@teunis2016] | serodynamics |
141-
|--------------------|-----------------------------|-----------------------|
142+
|------------------------|------------------------|------------------------|
142143
| Pathogen ODE | $\mu_0 b(t) - c y(t)$ | $\mu_b b(t) - \gamma y(t)$ |
143144
| Antibody ODE (pre-$t_1$) | $\mu y(t)$ | $\mu_y y(t)$ |
144145
| Antibody ODE (post-$t_1$) | $- \alpha y(t)^r$ | $- \alpha y(t)^\rho$ |
@@ -171,12 +172,15 @@ b_{0,ij} \\
171172
\alpha_{ij} \\
172173
\rho_{ij}
173174
\end{bmatrix}
174-
$$
175+
$$ **Where:**
175176
176-
**Hyperparameters – Means:**
177+
- $\theta_{ij}$: parameter vector for subject $i$, biomarker $j$\
178+
- $\mu_j$: population-level mean vector for biomarker $j$\
179+
- $\Sigma_{P,j} \in \mathbb{R}^{7 \times 7}$: covariance matrix **across parameters** for biomarker $j$
180+
- Subscript $P$: denotes that this is covariance over the **P parameters**\
181+
- Subscript $j$: indicates the biomarker index
177182
178-
- $\mu_j$: population-level mean vector for biomarker $j$
179-
- Prior on $\mu_j$:
183+
**Hyperparameters – Means:**
180184
181185
$$
182186
\mu_j \sim \mathcal{N}(\mu_{\text{hyp},j},\, \Omega_{\text{hyp},j})
@@ -235,13 +239,17 @@ $$
235239
\log(\alpha_{ij}) \\
236240
\log(\rho_{ij} - 1)
237241
\end{bmatrix}
242+
\in \mathbb{R}^5
238243
$$ {#eq-10}
239244
240245
Distribution:
241246
242247
$$
243248
\theta_{ij} \sim \mathcal{N}(\mu_j, \Sigma_{P,j})
244-
$$
249+
$$ **Where:**
250+
251+
- $\mu_j$: population-level mean vector for biomarker $j$\
252+
- $\Sigma_{P,j} \in \mathbb{R}^{5 \times 5}$: covariance matrix **across the** $P=5$ parameters for biomarker $j$
245253
246254
------------------------------------------------------------------------
247255
@@ -312,8 +320,8 @@ $$
312320
313321
**Hyperparameters:**
314322
315-
- $\mu_j$: population-level means (per biomarker $j$)
316-
- $\Sigma_j$: $5 \times 5$ covariance matrix over parameters
323+
- $\mu_j$: population-level mean vector for biomarker $j$\
324+
- $\Sigma_{P,j} \in \mathbb{R}^{P \times P}, \; P=5$: covariance matrix **across the parameters** for biomarker $j$
317325
318326
------------------------------------------------------------------------
319327
@@ -334,7 +342,7 @@ $$
334342
\log(\alpha_{ij}) \\
335343
\log(\rho_{ij} - 1)
336344
\end{bmatrix},
337-
\quad \Sigma_{P,j} \in \mathbb{R}^{5 \times 5}
345+
\quad \Sigma_{P,j} \in \mathbb{R}^{P \times P}, \; P=5
338346
$$
339347
340348
Each subject $i$ has a unique 5-parameter vector per biomarker $j$, capturing individual-level variation in antibody dynamics.
@@ -371,8 +379,8 @@ $$
371379
\Sigma_{P,j}^{-1} \sim \mathcal{W}(\Omega_j, \nu_j)
372380
$$
373381
374-
- $\Sigma_j$: variability/covariance in subject-level parameters
375-
- $\Omega_j$: prior scale matrix
382+
- $\Sigma_{P,j}$: $5 \times 5$ covariance matrix of subject-level parameters for biomarker $j$\
383+
- $\Omega_j$: prior scale matrix (dimension $5 \times 5$)\
376384
- $\nu_j$: degrees of freedom
377385
378386
**Example:**
@@ -404,7 +412,7 @@ $$
404412
405413
## Matrix Algebra Computation
406414
407-
Let $P = 5$ (parameters), $J$ biomarkers. Then:
415+
Let $P = 5$ (parameters), $B$ biomarkers. Then:
408416
409417
$$
410418
\Theta_i =
@@ -440,18 +448,16 @@ $$
440448
441449
## Understanding $\text{vec}(\Theta_i)$
442450
443-
Each $\theta_{ij} \in \mathbb{R}^7$:
451+
Each $\theta_{ij} \in \mathbb{R}^5$:
444452
445453
$$
446454
\theta_{ij} =
447455
\begin{bmatrix}
448-
y_0 \\
449-
b_0 \\
450-
\mu_0 \\
451-
\mu_1 \\
452-
c \\
453-
\alpha \\
454-
r
456+
\log(y_{0,ij}) \\
457+
\log(y_{1,ij} - y_{0,ij}) \\
458+
\log(t_{1,ij}) \\
459+
\log(\alpha_{ij}) \\
460+
\log(\rho_{ij} - 1)
455461
\end{bmatrix}
456462
$$
457463
@@ -494,16 +500,20 @@ $$
494500
495501
------------------------------------------------------------------------
496502
497-
## Example: Kronecker Product with $P=2$, $B=3$
503+
## Example: Kronecker Product with $P = 5$, $B = 3$
498504
499505
Let:
500506
501507
$$
502508
\Sigma_P =
503509
\begin{bmatrix}
504-
\sigma_{11} & \sigma_{12} \\
505-
\sigma_{21} & \sigma_{22}
506-
\end{bmatrix},\quad
510+
\sigma_{y_0,y_0} & \sigma_{y_0,y_1-y_0} & \sigma_{y_0,t_1} & \sigma_{y_0,\alpha} & \sigma_{y_0,\rho-1} \\
511+
\sigma_{y_1-y_0,y_0} & \sigma_{y_1-y_0,y_1-y_0} & \sigma_{y_1-y_0,t_1} & \sigma_{y_1-y_0,\alpha} & \sigma_{y_1-y_0,\rho-1} \\
512+
\sigma_{t_1,y_0} & \sigma_{t_1,y_1-y_0} & \sigma_{t_1,t_1} & \sigma_{t_1,\alpha} & \sigma_{t_1,\rho-1} \\
513+
\sigma_{\alpha,y_0} & \sigma_{\alpha,y_1-y_0} & \sigma_{\alpha,t_1} & \sigma_{\alpha,\alpha} & \sigma_{\alpha,\rho-1} \\
514+
\sigma_{\rho-1,y_0} & \sigma_{\rho-1,y_1-y_0} & \sigma_{\rho-1,t_1} & \sigma_{\rho-1,\alpha} & \sigma_{\rho-1,\rho-1}
515+
\end{bmatrix},
516+
\quad
507517
I_B =
508518
\begin{bmatrix}
509519
1 & 0 & 0 \\
@@ -515,7 +525,7 @@ $$
515525
Then:
516526
517527
$$
518-
\Sigma_P \otimes I_B \in \mathbb{R}^{6 \times 6}
528+
\Sigma_P \otimes I_B \in \mathbb{R}^{15 \times 15}
519529
$$
520530
521531
------------------------------------------------------------------------
@@ -525,12 +535,21 @@ $$
525535
$$
526536
\Sigma_P \otimes I_B =
527537
\begin{bmatrix}
528-
\sigma_{11} & 0 & 0 & \sigma_{12} & 0 & 0 \\
529-
0 & \sigma_{11} & 0 & 0 & \sigma_{12} & 0 \\
530-
0 & 0 & \sigma_{11} & 0 & 0 & \sigma_{12} \\
531-
\sigma_{21} & 0 & 0 & \sigma_{22} & 0 & 0 \\
532-
0 & \sigma_{21} & 0 & 0 & \sigma_{22} & 0 \\
533-
0 & 0 & \sigma_{21} & 0 & 0 & \sigma_{22}
538+
\Sigma_P & 0 & 0 \\
539+
0 & \Sigma_P & 0 \\
540+
0 & 0 & \Sigma_P
541+
\end{bmatrix}
542+
\in \mathbb{R}^{15 \times 15}
543+
$$
544+
545+
where each block $\Sigma_P$ is the $5 \times 5$ covariance across parameters:
546+
547+
$$
548+
\Sigma_P =
549+
\begin{bmatrix}
550+
\sigma_{y_0,y_0} & \cdots & \sigma_{y_0,\rho-1} \\
551+
\vdots & \ddots & \vdots \\
552+
\sigma_{\rho-1,y_0} & \cdots & \sigma_{\rho-1,\rho-1}
534553
\end{bmatrix}
535554
$$
536555
@@ -554,59 +573,69 @@ $$
554573
555574
## Extending to Correlated Biomarkers
556575
557-
Assume $P=3$, $B=3$
576+
Assume $P=5$, $B=3$
558577
559578
Define:
560579
561580
$$
562-
\Sigma_K =
581+
\Sigma_P =
563582
\begin{bmatrix}
564-
\sigma_{11} & \sigma_{12} & \sigma_{13} \\
565-
\sigma_{21} & \sigma_{22} & \sigma_{23} \\
566-
\sigma_{31} & \sigma_{32} & \sigma_{33}
567-
\end{bmatrix},\quad
568-
\Sigma_J =
583+
\sigma_{y_0,y_0} & \sigma_{y_0,y_1-y_0} & \sigma_{y_0,t_1} & \sigma_{y_0,\alpha} & \sigma_{y_0,\rho-1} \\
584+
\sigma_{y_1-y_0,y_0} & \sigma_{y_1-y_0,y_1-y_0} & \sigma_{y_1-y_0,t_1} & \sigma_{y_1-y_0,\alpha} & \sigma_{y_1-y_0,\rho-1} \\
585+
\sigma_{t_1,y_0} & \sigma_{t_1,y_1-y_0} & \sigma_{t_1,t_1} & \sigma_{t_1,\alpha} & \sigma_{t_1,\rho-1} \\
586+
\sigma_{\alpha,y_0} & \sigma_{\alpha,y_1-y_0} & \sigma_{\alpha,t_1} & \sigma_{\alpha,\alpha} & \sigma_{\alpha,\rho-1} \\
587+
\sigma_{\rho-1,y_0} & \sigma_{\rho-1,y_1-y_0} & \sigma_{\rho-1,t_1} & \sigma_{\rho-1,\alpha} & \sigma_{\rho-1,\rho-1}
588+
\end{bmatrix},
589+
\quad
590+
\Sigma_B =
569591
\begin{bmatrix}
570592
\tau_{11} & \tau_{12} & \tau_{13} \\
571593
\tau_{21} & \tau_{22} & \tau_{23} \\
572594
\tau_{31} & \tau_{32} & \tau_{33}
573595
\end{bmatrix}
574596
$$
575597
598+
Here:
599+
600+
- $\Sigma_P$: covariance across the 5 parameters (size $5 \times 5$)\
601+
- $\Sigma_B$: covariance across the $B$ biomarkers (size $B \times B$)
602+
576603
------------------------------------------------------------------------
577604
578-
## Kronecker Product Structure: $\Sigma_K \otimes \Sigma_J$
605+
## Kronecker Product Structure: $\Sigma_P \otimes \Sigma_B$
579606
580607
$$
581-
\Sigma_K \otimes \Sigma_J =
582-
\begin{bmatrix}
583-
\sigma_{11}\Sigma_J & \sigma_{12}\Sigma_J & \sigma_{13}\Sigma_J \\
584-
\sigma_{21}\Sigma_J & \sigma_{22}\Sigma_J & \sigma_{23}\Sigma_J \\
585-
\sigma_{31}\Sigma_J & \sigma_{32}\Sigma_J & \sigma_{33}\Sigma_J
586-
\end{bmatrix}
608+
\text{Cov}(\text{vec}(\Theta_i)) = \Sigma_P \otimes \Sigma_B
587609
$$
588610
589-
Now biomarkers and parameters can be correlated.
611+
- $\Sigma_P$: $5 \times 5$ covariance across parameters\
612+
- $\Sigma_B$: $B \times B$ covariance across biomarkers\
613+
- The Kronecker product expands to a $(5B) \times (5B)$ covariance matrix\
614+
- Not block-diagonal — allows both parameter correlations *and* cross-biomarker correlations
590615
591616
------------------------------------------------------------------------
592617
593-
## Expanded Form: $\Sigma_K \otimes \Sigma_J$ (3x3)
618+
## Practical To-Do List (for Chapter 2)
594619
595-
The $9 \times 9$ matrix contains all combinations $\sigma_{ab}\tau_{cd}$
620+
**Model Implementation:**
596621
597-
Not block-diagonal — includes cross-biomarker correlation
622+
- Define parameter covariance $\Sigma_{P,j}$ (within each biomarker $j$)\
623+
- Define biomarker covariance $\Sigma_B$ (across biomarkers)\
624+
- Full covariance structure: $\text{Cov}(\text{vec}(\theta_i)) = \Sigma_P \otimes \Sigma_B$\
625+
- Priors: $\Sigma_{P,j}^{-1} \sim \mathcal{W}(\Omega_j, \nu_j)$, $\Sigma_B^{-1} \sim \mathcal{W}(\Omega_B, \nu_B)$
598626
599-
------------------------------------------------------------------------
627+
**Simulation Study (first step):**
600628
601-
## Practical To-Do List (for Chapter 2)
629+
- Generate fake longitudinal data with known $\Sigma_P$ and $\Sigma_B$\
630+
- Fit independence model ($I_B$) vs. correlated model ($\Sigma_B$)\
631+
- Evaluate recovery of true covariance structure
602632
603-
**Model Implementation:**
633+
**Validation on Real Data (next step):**
604634
605-
- Define full $\Sigma_J$ and prior: $\Sigma_J^{-1} \sim \mathcal{W}(\Psi, \nu)$\
606-
- Implement $\Sigma_K \otimes \Sigma_J$ in JAGS
635+
- Apply to Shigella longitudinal data\
636+
- Compare independence vs. correlated models (DIC, WAIC, posterior predictive checks)\
637+
- Summarize implications for epidemiologic utility
607638
608-
**Simulation + Validation:**
639+
**Deliverable:**
609640
610-
- Simulate individuals with correlated biomarkers\
611-
- Fit both block-diagonal and full-covariance models\
612-
- Compare fit: DIC, WAIC, predictive checks
641+
- Simulation + model comparison documented in a vignette for the serodynamics package

0 commit comments

Comments
 (0)