44//
55// @param vacc Vector of new vaccinations
66//
7- // @param beta Proportion (0 - 1) that don't seroconvert
7+ // @param beta Proportion (0 - 1) that seroconvert
88//
99// @param gamma Vector of daily rates of antibody waning (0 - 1) for both
1010// infection and vaccination. Assumes to exponential waning.
2121//
2222// infections <- rep(0.01, 100)
2323// vacc <- rep(0.001, 100)
24- // beta <- 0.05
24+ // beta <- 0.95
2525// gamma <- c(0.01, 0.001)
2626// delta <- 0.9
2727// init_pop_ab <- 0.2
2828// t <- 100
2929//
3030// detectable_antibodies(infections, vacc, beta, gamma, delta, init_pop_ab, t)
3131vector detectable_antibodies(vector infections, vector vacc,
32- real beta, vector gamma, real delta, real init_pop_ab, int t) {
32+ real beta, vector gamma, real delta, real k, real l,
33+ real init_pop_ab, int t) {
3334 vector [t] pop_ab;
3435 vector [t] inf_ab;
3536 vector [t] vac_ab;
3637
3738 // Infection antibodies (assumes all previous from infection)
3839 inf_ab[1 ] = init_pop_ab // initial antibodies
39- + ( 1 - beta) * infections[1 ] * ( 1 - init_pop_ab) // new seroconversion
40+ + beta * infections[1 ] // new seroconversion
4041 - init_pop_ab * gamma[1 ];
4142 // Vaccination antibodies
4243 vac_ab[1 ] = delta * vacc[1 ]; // vaccination
@@ -45,11 +46,11 @@ vector detectable_antibodies(vector infections, vector vacc,
4546 for (i in 2 : t) {
4647 // Infection antibodies
4748 inf_ab[i] = inf_ab[i - 1 ]
48- + ( 1 - beta) * infections[i] * (1 - pop_ab[i - 1 ]) // new seroconversion
49+ + beta * infections[i] * pow (1 - pop_ab[i - 1 ], k ) // new seroconversion
4950 - inf_ab[i - 1 ] * gamma[1 ]; // waning
5051 // Vaccination antibodies
5152 vac_ab[i] = vac_ab[i - 1 ]
52- + delta * vacc[i] // new seroconversion
53+ + delta * vacc[i] * pow( 1 - pop_ab[i - 1 ], l) // new seroconversion
5354 - vac_ab[i - 1 ] * gamma[2 ]; // vaccination waning
5455 // Population antibodies
5556 pop_ab[i] = inf_ab[i] + vac_ab[i];
0 commit comments