Skip to content

Commit 7a25b1a

Browse files
committed
in progress
1 parent a0a68b5 commit 7a25b1a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

R/antibody_decay_function.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ antibody_decay_curve = function(
2525
alpha = 0.00002192627,
2626
rho = 2
2727
# rho = 2 # exponential decay?
28-
)
28+
)
2929
{
3030

3131
t1 = t1f(
@@ -41,10 +41,18 @@ antibody_decay_curve = function(
4141
mu_y = mu_y,
4242
t1 = t1)
4343

44+
phase2_rho1 <- y1 * exp(-alpha * (t - t1))
45+
phase2_default <-
46+
y1 * (1+ (rho-1) * (y1 ^ (rho - 1)) * alpha * (t - t1))^(-1/(rho - 1))
4447
yt = ifelse(
4548
t < t1,
4649
y0 * exp(mu_y * t),
47-
y1 * (1+ (rho-1) * (y1 ^ (rho - 1)) * alpha * (t - t1))^(-1/(rho - 1))
50+
ifelse(
51+
rho == 1,
52+
phase2_rho1,
53+
phase2_default
54+
55+
)
4856
)
4957
return(yt)
5058
}

0 commit comments

Comments
 (0)