@@ -259,11 +259,38 @@ nai_one_group.log_likelihood = ll_onegroup_newvariant_infboost
259
259
nai_one_group. log_priors = priors_onegroup_newvariant
260
260
261
261
262
- function gather_uncertainty_one_group! (nai_one_group,prop_PCR_pos_mat,no_neg_PCR_pos_mat,prop_sero_pos_mat,infection_mat,sero_array)
262
+ function gather_uncertainty_one_group (nai_one_group,ct_fitted)
263
+ # Placeholder solve run to get length of matrix
264
+ p = [[2.5 ,nai_one_group. α,nai_one_group. γ,0.16 ,N,1 / 180 ];ct_fitted]
265
+ u0 = [N- 100 ,100 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ]
266
+
267
+ function new_variant_effect! (integrator)
268
+ integrator. p[1 ] *= 1.5
269
+ integrator. u[2 ] += 0.0
270
+ end
271
+
272
+ janendpoint = (Date (2021 ,1 ,30 ) - Date (2020 ,2 ,20 )). value
273
+ aprilendpoint = (Date (2021 ,4 ,30 ) - Date (2020 ,2 ,20 )). value
274
+ variant_cb = PresetTimeCallback ([janendpoint],new_variant_effect!)
275
+
276
+
277
+ sol = solve (nai_one_group. prob, BS3 ();tspan = (0 ,(Date (2021 ,6 ,1 ) - Date (2020 ,2 ,20 )). value),
278
+ callback = variant_cb, u0= u0, p= p, saveat = 1 )
279
+ ι = diff (sol[:C ])
280
+ # Define arrays
281
+ # # Gather the uncertainty over the PCR and seropos predictions
282
+ prop_PCR_pos_mat = zeros (length (ι),size (nai_one_group. MCMC_results. chain,1 ))
283
+ no_neg_PCR_pos_mat = zeros (length (ι),size (nai_one_group. MCMC_results. chain,1 ))
284
+ prop_sero_pos_mat = zeros (length (ι),size (nai_one_group. MCMC_results. chain,1 ))
285
+ infection_mat = zeros (length (ι),size (nai_one_group. MCMC_results. chain,1 ))
286
+
287
+ sero_array = vcat (nai_one_group. baseline_sero_array[1 : 30 ],[(1 - 0 )^ k for k in 1 : 500 ])
288
+
263
289
for j = 1 : size (nai_one_group. MCMC_results. chain,1 )
264
290
R₀ = nai_one_group. MCMC_results. chain[:R₀ ][j]
265
291
extra_transmissibility = nai_one_group. MCMC_results. chain[:extra_transmissibility ][j]
266
292
influx_exposed_new_variant = nai_one_group. MCMC_results. chain[:influx_exposed_new_variant ][j]
293
+
267
294
p_test = nai_one_group. MCMC_results. chain[:p_test ][j]
268
295
χ = nai_one_group. MCMC_results. chain[:χ ][j]
269
296
E₀ = nai_one_group. MCMC_results. chain[:E₀ ][j]
@@ -273,14 +300,14 @@ function gather_uncertainty_one_group!(nai_one_group,prop_PCR_pos_mat,no_neg_PCR
273
300
p = [[R₀,nai_one_group. α,nai_one_group. γ,0.16 ,N,1 / 180 ];ct_fitted]
274
301
u0 = [N- E₀,E₀,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ]
275
302
276
- function new_variant_effect ! (integrator)
303
+ function affect ! (integrator)
277
304
integrator. p[1 ] *= extra_transmissibility
278
305
integrator. u[2 ] += influx_exposed_new_variant
279
306
end
280
307
281
308
janendpoint = (Date (2021 ,1 ,30 ) - Date (2020 ,2 ,20 )). value
282
309
aprilendpoint = (Date (2021 ,4 ,30 ) - Date (2020 ,2 ,20 )). value
283
- variant_cb = PresetTimeCallback ([janendpoint],new_variant_effect !)
310
+ variant_cb = PresetTimeCallback ([janendpoint],affect !)
284
311
285
312
sol = solve (nai_one_group. prob, BS3 ();tspan = (0 ,(Date (2021 ,6 ,1 ) - Date (2020 ,2 ,20 )). value),
286
313
callback = variant_cb, u0= u0, p= p, saveat = 1 )
@@ -299,5 +326,5 @@ function gather_uncertainty_one_group!(nai_one_group,prop_PCR_pos_mat,no_neg_PCR
299
326
no_neg_PCR_pos_mat[:,j] .= PCR_pred
300
327
prop_sero_pos_mat[:,j] .= sero
301
328
end
302
- return nothing
329
+ return (;infection_mat,prop_PCR_pos_mat,no_neg_PCR_pos_mat,prop_sero_pos_mat)
303
330
end
0 commit comments