-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_parameters.py
93 lines (89 loc) · 8.33 KB
/
plot_parameters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import matplotlib.pyplot as plt
import numpy as np
from datetime import date
param_names = ['Beta',
'Rho',
'Sigma',
'Tau',
'Delta',
'Theta1',
'Theta2',
'Gamma1',
'Gamma2',
'Gamma3',
'Gamma4',
'Mu1',
'Mu2',
'Eta']
parameters = [
[0.04417909904136072, 0.16666666666666666, 0.25, 0.002607505957964171, 0.04506954288814314, 0.04000391524885744,
0.05945901639344263, 0.09824561403508772, 0.001, 0.09442629590963579, 0.010625, 0.008623746131208974,
0.5360234479440541, 0.017051185637991156],
[0.04271173866387728, 0.17873099205973036, 0.48077474701234385, 0.001496307466062664, 0.01795084287535577,
0.01020473022643667, 0.026448479893415137, 0.09981598389810127, 0.06416735909449253, 0.10101010101010101,
0.0329622386461159, 0.4348792278828317, 0.43971725559769304, 0.019722199406887207],
[0.18896851158715078, 0.18706606005630683, 0.28005015665764743, 0.0006069235077946143, 0.019381691800506796,
0.021534103103064736, 0.05018119923827652, 0.1919882087569018, 0.030157869507219617, 0.08022611771744065,
0.04912210183222269, 0.011006785812258257, 0.7708926655590773, 0.015971950177058068],
[0.14309267694914724, 0.1873442755499069, 0.7048478353537913, 0.0006454553103009291, 0.03823107205152074,
0.014420734454821503, 0.029292199295500258, 0.11829667907225225, 0.0818183341206609, 0.09659714442456281,
0.04798080264921898, 0.029438071975157663, 0.4645005983811566, 0.032704898803983654],
[0.23645155645273003, 0.17611768641688785, 0.3477731553741625, 0.0015422358508170686, 0.034200769720435925,
0.0063505387573834105, 0.01287826674248012, 0.19334442910187327, 0.06365726179362154, 0.05206696896409975,
0.03578623628590484, 0.6318146700222789, 0.27396821986554026, 0.07318573239060001],
[0.19954839542401634, 0.19675645064497557, 0.3214922227714413, 0.002085859106403714, 0.036734637840919404,
0.015546988039596431, 0.046492157559684465, 0.11447312653816906, 0.007615625535035378, 0.07353946308014339,
0.01744844755718321, 0.05198057193815203, 0.5187808949179322, 0.14530253797727027],
[0.12105763349435648, 0.16680652511604088, 0.7373014129558625, 0.0019222179402129946, 0.030947036564513163,
0.032357698870248315, 0.01959951149209873, 0.19326462316731205, 0.037774001791624386, 0.10101010101010101,
0.036301871517823596, 0.03351049557244116, 0.26562217074652733, 0.09436521002366965],
[0.18734771954492072, 0.17248396613817968, 0.6117386132553728, 0.0023674667906282113, 0.022585280945423548,
0.028057005218742406, 0.032584061431908826, 0.16777542121682318, 0.0451615840198355, 0.07507796518966266,
0.03572724713458639, 0.060160497625902046, 0.6513565057086848, 0.05590641059638597],
[0.20706543319838705, 0.1675073781095676, 0.2895121281202713, 0.0038911643379408176, 0.031058282426042864,
0.013357868185996625, 0.0579718109091564, 0.19582181285061223, 0.061466555070124745, 0.07883248082559581,
0.029048436241333263, 0.04521675298771622, 0.25503968975030133, 0.2398266420122448],
[0.3495513813402461, 0.1757375667186865, 0.7419412492861541, 0.0023838733095558067, 0.04147979701047269,
0.007598013172891928, 0.023814050319704832, 0.17290275121104545, 0.04339814744541998, 0.07762910865562846,
0.015252411513868417, 0.018980153002800135, 0.3154897098049746, 0.19559589620971338],
[0.22149298682627025, 0.18134490480308654, 0.5682789905320313, 0.002802470215709582, 0.03667414309882367,
0.007785770780693508, 0.025423683520389824, 0.18454088574224045, 0.07432265951138227, 0.05353125003555775,
0.0422617939281555, 0.10336965932369303, 0.5502838931807575, 0.0841251336388422]]
"""
parameters = [[0.05207787586829836, 0.19437643151889256, 0.25882927627499613, 0.002598930041432537, 0.03287024477593973, 0.04453632115704963, 0.043164074052456904, 0.1012552267256648, 0.012232171157036167, 0.07820882346067388, 0.01591714941492931, 0.03179822629884987, 0.531371856470449, 0.015795676481463492],
[0.042580445381067644, 0.19855726567799162, 0.4160429190779611, 0.0014213257760221382, 0.015004650714616805, 0.010992118275774239, 0.014521267537479501, 0.09955268056579478, 0.07396785198328328, 0.10101010101010101, 0.010625, 0.3646120976917083, 0.14478147893555207, 0.04061366407215736],
[0.15489359314892692, 0.18842828490946634, 0.27351583233288335, 0.0005304404741883941, 0.01804032705080283, 0.022654575127180242, 0.056932759623164894, 0.1769189494535064, 0.0313662292228856, 0.06941526824193904, 0.017247297627200866, 0.0037748375541183563, 0.817361352961781, 0.0129267433464979],
[0.1302201137419986, 0.17755726657210547, 0.6452869088901922, 0.0006761670439700634, 0.03457114169047097, 0.016998128521748868, 0.016990837067024485, 0.10535878251828285, 0.08008654051490204, 0.08880191590653053, 0.039236209396366545, 0.028186310961590917, 0.3790734495464846, 0.042489654998359105],
[0.22884833859280537, 0.16794027185841648, 0.36436077798529637, 0.0015018622965502658, 0.027635021632397682, 0.007041235713902612, 0.013804766090680381, 0.18220199882811536, 0.06254748499679383, 0.024252572041956404, 0.029851547463444157, 0.29225764826733935, 0.10797517346264168, 0.19028304618871492],
[0.252336663645288, 0.19580355524875773, 0.7742179955434318, 0.0018474995266605462, 0.025013656626227596, 0.016631096606959443, 0.03902398034656313, 0.1282046572066014, 0.01746797515679178, 0.017429378077307312, 0.012902413194730896, 0.09323596052848715, 0.2505751132062415, 0.2491891240582348],
[0.07858372777031208, 0.19609851995692568, 0.5907115116342876, 0.0017427170957019802, 0.027722191094874723, 0.03012208375367326, 0.02944972556743967, 0.1458556750166045, 0.053334889850102006, 0.08196548271216583, 0.03835589765898502, 0.6934051801205784, 0.10794887224360744, 0.086763243385961],
[0.12179702394444493, 0.18121097803108674, 0.5140083656251496, 0.0018889409174304298, 0.018681256821450592, 0.030271122089632136, 0.02340742464661904, 0.10503129400465595, 0.041062325499932155, 0.06970215949440424, 0.023954015461603785, 0.0526663626622299, 0.7602502846573451, 0.04065411298455111],
[0.21226316977814352, 0.16666666666666666, 0.3618362784437883, 0.0029726865683662364, 0.01741996833307565, 0.02385226158250797, 0.00841424915269018, 0.17625219269362408, 0.05692536968340551, 0.06874471212926578, 0.025020895630079566, 0.21052404200055003, 0.7329949242046176, 0.06963102651115033],
[0.3336891078922028, 0.1712618586688713, 0.6500714506322569, 0.002073418868413918, 0.0347500642968689, 0.012875059419537503, 0.007598149933121957, 0.17877458774699986, 0.04166568929935376, 0.0750847602273164, 0.016382630314136816, 0.43909544509965875, 0.8547447143925153, 0.056584642589059916],
[0.2544145137878209, 0.17123596088107365, 0.7535795905274528, 0.002486910877983372, 0.03271485568319763, 0.009054672869941872, 0.022431677032460125, 0.1978573017254884, 0.08550130432592656, 0.043689364771055436, 0.03919024387743541, 0.29973127456274046, 0.8737001639818918, 0.04422319081715245]]
"""
dates = [date(2020, 3, 13), date(2020, 5, 4), date(2020, 6, 8),
date(2020, 7, 25), date(2020, 9, 24), date(2020, 10, 6), date(2020, 11, 2),
date(2020, 12, 1), date(2021, 1, 27), date(2021, 3, 1), date(2021, 3, 27)]
info = "WithVaccinatie_Optimal"
ax = plt.subplot(111)
ax.set_prop_cycle('color', ['blue', 'green', 'red', 'cyan', 'magenta', 'yellow', 'black', 'brown', 'orange', 'purple', 'pink', 'lime', 'deepskyblue', 'grey'])
print("Param Name - [Min; Max] - Mean - Std")
for param_name, param in zip(param_names, np.transpose(parameters)):
#plt.title(param_name)
print("{} - [{:.4f}, {:.4f}] - {} - {:.4f}".format(param_name, min(param), max(param), np.mean(param), np.std(param)))
plt.plot(dates, param, label = param_name)
#plt.savefig('img/{}_{}.pdf'.format(info, param_name))
plt.legend()
plt.savefig('img/{}_parameters.pdf'.format(info))
plt.show()
plt.figure()
#for param_name, param in zip(param_names, np.transpose(parameters)):
#plt.boxplot(param, labels = [param_name])
plt.title("Boxplot Parameters")
plt.boxplot(np.array(parameters)) #np.transpose(parameters)
ticks = range(1, len(parameters[0])+1)
labels = param_names
plt.xticks(ticks, labels)
plt.savefig('img/Boxplot_{}_parameters.pdf'.format(info))
plt.show()