Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review why it works #83

Closed
seabbs opened this issue Sep 18, 2024 · 3 comments · Fixed by #88
Closed

Review why it works #83

seabbs opened this issue Sep 18, 2024 · 3 comments · Fixed by #88
Labels
enhancement New feature or request

Comments

@seabbs
Copy link
Contributor

seabbs commented Sep 18, 2024

I spoke to @parksw3 a bit about this and if interested a review of the why it works sections would be great.

@seabbs seabbs added the enhancement New feature or request label Sep 18, 2024
@parksw3
Copy link

parksw3 commented Sep 18, 2024

In order to reason upon the distribution of the censored delay time $T_c$, it is useful to consider the time from the end (right) point of the primary censoring interval to the secondary time as a random variable,

$$ S_+ = S - (t_P + w_P) = T - ((t_P + w_P) - P) = T - C_P. $$

Where $T$ is the delay distribution of interest and $C_P = (t_P + w_P) - P$ is interval between the end (right) point of the primary censoring window and the primary event time; note that by definition $C_P$ is not observed but we can relate its distribution to the distribution of $P$: $F_{C_P}(p) = Pr(C_P < p) = Pr(P > w_P - p)$.

I'm confused about the last equation. Maybe I'm missing something obvious here. Shouldn't the last equation be:

$F_{C_P}(p) = Pr(C_P < p) = Pr((t_P + w_P) - P < p) = Pr(P > t_P + w_P - p)$?

It looks like it's missing $t_P$?

Otherwise, this all looks great to me. I think it's worth specifying the implicit assumption that the delay distribution doesn't change over time (see below).

@parksw3
Copy link

parksw3 commented Sep 18, 2024

The use of integration by part is very neat. And so I'm guessing we can do the same with the derivation in the long paper, which might give slightly simpler notation and consistency?

Starting from here (equations 12-14 in the long paper):

$$ \begin{aligned} \mathrm{P}(S_L < S < S_R | P_L < P < P_R) &= \frac{\mathrm{P}(P_L < P < P_R, S_L < S < S_R)}{\mathrm{P}(P_L < P < 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(x) dx}\\ &= \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} $$

If we assume that the forward distribution doesn't vary over time (such that $f_x = f$), then

$$ \int_{P_L}^{P_R} \int_{S_L}^{S_R} g_P(x|P_L, P_R) f_x(y-x)dy dx = \int_{P_L}^{P_R} g_P(x|P_L, P_R) \big[F(S_R - x) - F(S_L - x)\big] dx $$

Then, by using integration by parts, we get:

$$ \begin{aligned} \int_{P_L}^{P_R} g_P(x|P_L, P_R) \big[F(S_R - x) - F(S_L - x)\big] dx &= F(S_R - P_R) - F(S_L - P_R) - \int_{P_L}^{P_R} G_P(x|P_L, P_R) \big[f(S_L - x) - f(S_R - x)\big] dx \end{aligned} $$

which is same as equation 3.2 in the current vignette.

And we can use the same treatment when we account for the truncation+censoring... (writing more later)

@SamuelBrand1
Copy link
Collaborator

It looks like it's missing t P ?

Yes! Thats a typo (I think, I'll just double check myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants