abm_timeseries.jl 1.31 KB
Newer Older
1
2
3
using CovidAlertVaccinationModel
using OnlineStats
using Plots
4
5
6
7
8
9
10
const samples = 5

const vaccination_data = [0.0,0.043,0.385,0.424,0.115,0.03,0.005] #by month starting in august
const ymo_vac = [0.255,0.278,0.602]
const ymo_attack_rate = [10.376,5.636,7.2]./100


11
function solve_and_plot_parameters()
12
    p =  CovidAlertVaccinationModel.get_parameters()
13
    out,avg_populations = mean_solve(samples, p,DebugRecorder)
14
    p = plot_model(nothing,[nothing],[out],p.infection_introduction_day,p.immunization_begin_day)
15

16
    ymo_vaccination_ts = mean.(out.daily_immunized_by_age)
17

18
19
20
21
22
23
    total_postinf_vaccination = sum.(eachrow(ymo_vaccination_ts[:,1180:end]))
    final_size = sum.(eachrow(mean.(out.daily_unvac_cases_by_age)))
    total_preinf_vaccination = sum.(eachrow(ymo_vaccination_ts[:,1:1180]))
    target_final_size = ymo_attack_rate .*avg_populations
    target_preinf_vac = ymo_vac .* sum(vaccination_data[1:4]) .* avg_populations
    target_postinf_vac = ymo_vac .* sum(vaccination_data[5:end]) .*avg_populations
24

25
26
27
28
29
  
    display((final_size,target_final_size))
    display((total_preinf_vaccination,target_preinf_vac))
    display((total_postinf_vaccination,target_postinf_vac))
    display(sum.(eachrow(ymo_vaccination_ts)) ./avg_populations)    
30

31
32
33
    savefig(p,"timeseries.pdf")
    return out
end
34

35
out = solve_and_plot_parameters()