From fb7ed4de4facd37489da152aff85f88d64bc3564 Mon Sep 17 00:00:00 2001 From: Sang Woo Park Date: Tue, 22 Oct 2024 00:11:37 -0500 Subject: [PATCH] more udpates --- vignettes/model.Rmd | 51 ++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/vignettes/model.Rmd b/vignettes/model.Rmd index 53d5b1ba8..47576bc06 100644 --- a/vignettes/model.Rmd +++ b/vignettes/model.Rmd @@ -108,49 +108,66 @@ $$ Now, assume that both primary $P$ and secondary $S$ events are truncated. We only know that the primary event happened between $P_L$ and $P_R$ and the secondary event happened between $S_L$ and $S_R$. -We now write $g_P$ to denote the distribution of primary events. +We now write $g_P$ to denote the unconditional distribution of primary events. Then, $$ \begin{aligned} \mathbb{P}(S_L < S < S_R \, | \, P_L < P < P_R) &= \mathbb{P}(P_L < P < P_R, S_L < S < S_R \, | \, P_L < P < P_R)\\ &= \frac{\mathbb{P}(P_L < P < P_R, S_L < S < S_R)}{\mathbb{P}(P_L < P < P_R)}\\ -&= \frac{\mathbb{P}(P_L < P < P_R, S_L < S < S_R)}{\int_{P_L}^{P_R} }\\ +&= \frac{\int_{P_L}^{P_R} \int_{S_L}^{S_R} g_P(x) f_x(y-x) \,dy\, dx}{\int_{P_L}^{P_R} g_P(z)\, dz }\\ +&= \int_{P_L}^{P_R} \int_{S_L}^{S_R} g_P(x\,|\,P_L,P_R) f_x(y-x) \,dy\, dx \end{aligned} $$ +where $ g_P(x\,|\,P_L,P_R)$ represents the conditional distribution of primary event given lower $P_L$ and upper $P_R$ bounds. # The latent individual model -Let $\mathbf{Y}$ be the data vector and $\boldsymbol{\theta}$ be parameters. -Then -$$ -\mathcal{L}(\mathbf{Y} \, | \, \boldsymbol{\theta}) = \prod_i \mathbb{P}(S_{L, i} < S < S_{R, i} \, | \, P_{L, i} < P < P_{R, i}, S < T). +Now, we incorporate both truncation and double censoring: $$ - - - -Using latent variables, together with Equation \@ref(eq:right-truncation), then +\begin{aligned} +\mathbb{P}(S_L < S < S_R \, | \, P_L < P < P_R, S + + + + + -1. Assume primary event incidence constant -\begin{align} +Instead, the approach of the `latent_individual` model [@ward2022transmission] is to: + +1. Assume a uniformly distributed primary event times +$$ +\begin{aligned} x_i &\sim \text{Unif}(p_{L, i}, p_{R, i}) \\ y_i &\sim \text{Unif}(s_{L, i}, s_{R, i}). -\end{align} +\end{aligned} +$$ 2. Assume that censoring interval is narrow such that $$ -\int_{P_{L, i}}^{P_{R, i}} g_P(z \, | \, p_{L, i}, p_{R, i}) F_x(T - z) \text{d}z \approx F_x(T - x_i). +\int_{P_{L, i}}^{P_{R, i}} g_P(z \, | \, p_{L, i}, p_{R, i}) F_{x_i}(T - z) \text{d}z \approx F_{x_i}(T - x_i). $$ Then