import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.cm as cm
import pandas as pd
import matplotlib.ticker as mticker
import matplotlib
from matplotlib.pyplot import figure
from matplotlib.ticker import FormatStrFormatter
import numpy as np
from pathlib import Path
Path("./content/sample_data").mkdir(parents=True, exist_ok=True)
# Set policy efficiencies
test_cap = 0.001
hygiene = 0.30
distancing = 0.74
lockdown = 0.96
quarantine = 0.96
# ASSUMPTIONS:
# Virus parameters
transmission_days = 16.33/2.40
exposed_days = 5.27
recovery_days = 16.33
r0 = 2.64
transmission_rate = (1/ transmission_days)
incubation_rate = (1/ exposed_days)
recovery_rate = (1/ recovery_days)
# Country parameters
hospital_cap = 6/10000
death_rate_with_med = 0.6 # 60% chance to die with ICU treatment
death_rate_without_med = 1 # 100% chance to die without ICU treatment
general_dr = 0.02 # 2% death rate
icu_case_rate = 0.06 # 6% need ICU treatment
ser_case_rate = 0.15 # 15% of serious cases
# Initialize
susceptible0 = 0.99
infected0 = 0.01
exposed0 = 0
recovered0 = 0
population = 1000000
policy_start = 30
policy_end = 60
days = 300
def virus_model(days,policy):
if policy == "hygiene":
pol = hygiene
elif policy == "distancing":
pol = distancing
elif policy == "lockdown":
pol = lockdown
elif policy == "quarantine":
pol = quarantine
elif policy == "None":
pol = None
# set values for the first date of the simulation
susceptible = susceptible0
infected = infected0
exposed = exposed0
recovered = recovered0
dead = 0
# Scale to population size
susc= [population * susceptible0]
exp = [population * exposed0]
inf = [population * infected0]
rec = [population * recovered0]
re = [r0]
d = [0]
for day in range(days):
if policy_start < day < policy_end and pol != None:
transmission_rate = (1/ transmission_days) * (1-pol)
else:
transmission_rate = (1/ transmission_days)
# Simulate flow between compartments
S2E = susceptible * infected * transmission_rate
E2I = exposed * incubation_rate
I2D = general_dr*infected/recovery_days
# Account different death rates depending on condition
if (icu_case_rate*infected < hospital_cap):
I2D += icu_case_rate*infected*death_rate_with_med/recovery_days
else:
I2D += hospital_cap*death_rate_with_med/recovery_days + (icu_case_rate*infected - hospital_cap) * death_rate_without_med/recovery_days
I2R = (1-general_dr)*infected*recovery_rate
# Update the compartments
exposed += S2E
susceptible -= S2E
infected += E2I
exposed -= E2I
recovered += I2R
infected -= I2R
infected -= I2D
dead += I2D
re.append((transmission_rate/ recovery_rate)*susceptible)
susc.append(population* susceptible)
exp.append(population* exposed)
inf.append(population* infected)
rec.append(population* recovered)
d.append(population* dead)
return susc, exp, inf, rec, d, re
result_h = virus_model(days,'hygiene')
result_d = virus_model(days,'distancing')
result_l = virus_model(days,'lockdown')
result_q = virus_model(days,'quarantine')
result_0 = virus_model(days,'None')
m = [m for m in range(days+1)]
# Plot the graphs
# Here we plot only lockdown
sns.set_style("ticks")
matplotlib.rcParams['figure.figsize'] = 8, 6
sns.despine()
formatter = mticker.ScalarFormatter(useMathText=True)
f = mticker.ScalarFormatter(useOffset=False, useMathText=True)
g = lambda x,pos : "${}$".format(f._formatSciNotation('%10e' % x))
plots = ['Susceptible','Exposed', 'Infected','Recovered','Death cases']
abbrev = ['S','E', 'I','R','D']
for num,policy in enumerate(plots):
plt.plot(m, result_0[num], label="No policy", color ='grey',linewidth=2.5)
plt.plot(m, result_l[num], label="Lockdown", color ='green',linewidth=2.5)
plt.axvline(x=policy_start,linestyle='--', linewidth=1.5, label='Policy start')
plt.axvline(x=policy_end,linestyle='--', linewidth=1.5, color='red', label='Policy end')
plt.tick_params(labelsize=22)
plt.ylabel(policy, fontsize=22)
plt.xlabel('Days', fontsize=22)
plt.legend(fontsize=22)
sns.despine()
plt.gca().yaxis.set_major_formatter(mticker.FuncFormatter(g))
plt.savefig('./content/sample_data/{}.pdf'.format(abbrev[num]),bbox_inches='tight')
plt.show()
# Set policy efficiencies
test_cap = 0.001
hygiene = 0.30
distancing = 0.74
lockdown = 0.96
quarantine = 0.96
# ASSUMPTIONS:
# Virus parameters
transmission_days = 16.33/2.40
exposed_days = 5.27
recovery_days = 16.33
r0 = 2.64
transmission_rate0 = (1/ transmission_days)
incubation_rate = (1/ exposed_days)
recovery_rate = (1/ recovery_days)
# Country parameters
hospital_cap = 6/10000
death_rate_with_med = 0.6 # 60% chance to die with ICU treatment
death_rate_without_med = 1 # 100% chance to die without ICU treatment
general_dr = 0.02 # 2% death rate
icu_case_rate = 0.06 # 6% need ICU treatment
ser_case_rate = 0.15 # 15% of serious cases
# Initialize
susceptible0 = 0.99
infected0 = 0.01
exposed0 = 0
recovered0 = 0
population = 1000000
# Policy costs:
lockdown_cost = 0.1 # 10% of yearly GDP
quarantine_cost = 0.05 # 5% of yearly GDP
mask_cost = 0.002 # 2$
distancing_cost = 0.05 # 5% of yearly GDP
def evaluate(inf, rec, d, policy, cont_tracing):
''' Calculate penalty points '''
dd_point = -7000 # death
inf_point = -0.3 # infection
ct_point = -6.4 # contact_tracing
result = sum(inf)*inf_point + d[-1]*dd_point + sum(policy) + sum(cont_tracing)*ct_point
return result
def virus_model(hygiene_list, distancing_list,lockdown_list,quarantine_list):
assert len(hygiene_list) == len(distancing_list) == len(lockdown_list) == len(quarantine_list)
duration = len(hygiene_list)
susceptible = susceptible0
infected = infected0
exposed = exposed0
recovered = recovered0
dead = 0
susc= [population * susceptible0]
exp = [population * exposed0]
inf = [population * infected0]
rec = [population * recovered0]
cont_tracing = [] #for calculating contact tracing price
re = [r0]
d = [0]
policy = []
for day in range(duration):
# mitigate transmission rate (Re) by applying policies:
transmission_rate = transmission_rate0 * (1- hygiene_list[day]*hygiene) * (1- distancing_list[day]*distancing) * (1- lockdown_list[day]*lockdown) * (1- quarantine_list[day]*quarantine)
# calculate loss per day for each policy
ld_point = - population * lockdown_cost * 30 /365 # account for 30k$ of yearly GDP
qr_point = - population * quarantine_cost * 30 /365 # account for 30k$ of yearly GDP
hg_point = - population * mask_cost
dst_point = - population * distancing_cost * 30 /365 # account for 30k$ of yearly GDP
policy_point = hg_point * hygiene_list[day] + dst_point * distancing_list[day] + ld_point*lockdown_list[day] + qr_point*quarantine_list[day]
# Simulate the flow between compartments
S2E = susceptible * infected * transmission_rate
E2I = exposed * incubation_rate
I2D = general_dr*infected/recovery_days
# Account different death rates depending on condition
if (icu_case_rate*infected < hospital_cap):
I2D += icu_case_rate*infected*death_rate_with_med/recovery_days
else:
I2D += hospital_cap*death_rate_with_med/recovery_days + (icu_case_rate*infected - hospital_cap) * death_rate_without_med/recovery_days
I2R = (1-general_dr)*infected*recovery_rate
# Update the compartments
exposed += S2E
susceptible -= S2E
infected += E2I
exposed -= E2I
recovered += I2R
infected -= I2R
infected -= I2D
dead += I2D
re.append((transmission_rate/ recovery_rate)*susceptible)
susc.append(population* susceptible)
exp.append(population* exposed)
inf.append(population* infected)
rec.append(population* recovered)
d.append(population* dead)
policy.append(policy_point)
# Append number of exposed people for each date for contact-tracing loss estimation in evaluate()
cont_tracing.append(S2E*quarantine_list[day]*population)
return susc, exp, inf, rec, d, re, policy, cont_tracing
# h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3
# numbers indicate month. Ex: l2 = 0.5 -> half lockdown is applied in 2nd month
result = np.zeros((3,3,3,3,3,3,3,3,3,3,3,3), dtype = float)
for index, value in np.ndenumerate(result):
h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3 = index
# Filter out unreasonable cases: Lockdown and social distancing in the same month
# OR Distacing and (distabncing + tracing) in the same month
if (d1!=0 and q1!=0) or (d2!=0 and q2!=0) or (d3!=0 and q3!=0) or \
(l1!=0 and (q1!=0 or d1!=0)) or (l2!=0 and (d2!=0 or q2!=0)) or (l3!=0 and (d3!=0 or q3!=0)):
result[h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3] = None
continue
# Divide by two to get the policy strength: 0, 50%, 100%
hygiene_list = [h1/2]*30 + [h2/2]*30 + [h3/2]*30
distancing_list = [d1/2]*30 + [d2/2]*30 + [d3/2]*30
lockdown_list = [l1/2]*30 + [l2/2]*30 + [l3/2]*30
quarantine_list = [q1/2]*30 + [q2/2]*30 + [q3/2]*30
# Get the compartments
susc, exp, inf, rec, d, re, policy,cont_tracing = virus_model(hygiene_list, distancing_list,lockdown_list,quarantine_list)
# Evaluate the loss
point = evaluate(inf, rec, d, policy,cont_tracing)
result[h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3] = point
#no policy case
print(result[0,0,0,0,0,0,0,0,0,0,0,0])
-197972647.11065745
# Optimal policy loss
loss = np.nanmax(result)
arg = np.unravel_index(np.nanargmax(result), result.shape)
print(loss, arg)
-4525982.639901729 (2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2)
index = []
index.append([0,0,0,0,0,0,0,0,0,0,0,0])
index.append([2,2,2,0,0,0,0,0,0,0,0,0]) # hygiene
index.append([0,0,0,2,2,2,0,0,0,0,0,0]) # distancing
index.append([0,0,0,0,0,0,2,2,2,0,0,0]) # lockdown
index.append([0,0,0,0,0,0,0,0,0,2,2,2]) # quarantine
index.append([2,0,0,0,0,0,0,0,0,2,2,2]) # optimal combination
ind = np.unique(np.asarray(index), axis = 0)
ind.shape
(6, 12)
# Set policy efficiencies
test_cap = 0.001
hygiene = 0.30
distancing = 0.74
lockdown = 0.96
quarantine = 0.96
# ASSUMPTIONS:
# Virus parameters
transmission_days = 16.33/2.40
exposed_days = 5.27
recovery_days = 16.33
r0 = 2.64
transmission_rate0 = (1/ transmission_days)
incubation_rate = (1/ exposed_days)
recovery_rate = (1/ recovery_days)
# Country parameters
hospital_cap = 6/10000
death_rate_with_med = 0.6 # 60% chance to die with ICU treatment
death_rate_without_med = 1 # 100% chance to die without ICU treatment
general_dr = 0.02 # 2% death rate
icu_case_rate = 0.06 # 6% need ICU treatment
ser_case_rate = 0.15 # 15% of serious cases
# Initialize
susceptible0 = 0.99
infected0 = 0.01
exposed0 = 0
recovered0 = 0
population = 1000000
# Policy costs:
lockdown_cost = 0.1 # 10% of yearly GDP
quarantine_cost = 0.05 # 5% of yearly GDP
mask_cost = 0.002 # 2$
distancing_cost = 0.05 # 5% of yearly GDP
def evaluate(inf, rec, d, policy, cont_tracing):
''' Calculate penalty points '''
dd_point = -7000
inf_point = -0.3
contact_tracing_point = -6.4
result = [-1000*(sum(inf[:i])*inf_point + d[i]*dd_point + sum(policy[:i])+ contact_tracing_point*sum(cont_tracing[:i])) for i in range(len(d))]
return result
def virus_model(hygiene_list, distancing_list,lockdown_list,quarantine_list):
assert len(hygiene_list) == len(distancing_list) == len(lockdown_list) == len(quarantine_list)
duration = len(hygiene_list)
susceptible = susceptible0
infected = infected0
exposed = exposed0
recovered = recovered0
dead = 0
susc= [population * susceptible0]
exp = [population * exposed0]
inf = [population * infected0]
rec = [population * recovered0]
cont_tracing = []
re = [r0]
d = [0]
policy = []
testing = 0
for day in range(duration):
# mitigate transmission rate (Re) by applying policies:
transmission_rate = transmission_rate0 * (1- hygiene_list[day]*hygiene) * (1- distancing_list[day]*distancing) * (1- lockdown_list[day]*lockdown) * (1- quarantine_list[day]*quarantine)
# calculate loss per day for each policy
ld_point = - population * lockdown_cost * 30 /365 # account for 30k$ of yearly GDP
qr_point = - population * quarantine_cost * 30 /365 # account for 30k$ of yearly GDP
hg_point = - population * mask_cost
dst_point = - population * distancing_cost * 30 /365 # account for 30k$ of yearly GDP
policy_point = hg_point * hygiene_list[day] + dst_point * distancing_list[day] + ld_point*lockdown_list[day] + qr_point*quarantine_list[day]
# Simulate the flow between compartments
S2E = susceptible * infected * transmission_rate
E2I = exposed * incubation_rate
I2D = general_dr*infected/recovery_days
# Account different death rates depending on condition
if (icu_case_rate*infected < hospital_cap):
I2D += icu_case_rate*infected*death_rate_with_med/recovery_days
else:
I2D += hospital_cap*death_rate_with_med/recovery_days + (icu_case_rate*infected - hospital_cap) * death_rate_without_med/recovery_days
I2R = (1-general_dr)*infected*recovery_rate
# Update the compartments
exposed += S2E
susceptible -= S2E
infected += E2I
exposed -= E2I
recovered += I2R
infected -= I2R
infected -= I2D
dead += I2D
# Append number of exposed people for each date for contact-tracing loss estimation in evaluate()
re.append((transmission_rate/ recovery_rate)*susceptible)
susc.append(population* susceptible)
exp.append(population* exposed)
inf.append(population* infected)
rec.append(population* recovered)
d.append(population* dead)
policy.append(policy_point)
cont_tracing.append(S2E*quarantine_list[day]*population)
return susc, exp, inf, rec, d, re, policy, cont_tracing
# Plot
figure(figsize=(10, 6), dpi=80)
legends = ['No policy (worst)', 'Hygiene & Mask', 'Distancing', 'Lockdown', 'Distancing + tracing', 'Optimal policy']
al = [0.7]*5+[1]
col = cm.rainbow(np.linspace(0, 1, 6))
plt.yscale('log')
for i,indice in enumerate(index):
h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3 = indice
hygiene_list = [h1/2]*30 + [h2/2]*30 + [h3/2]*30
distancing_list = [d1/2]*30 + [d2/2]*30 + [d3/2]*30
lockdown_list = [l1/2]*30 + [l2/2]*30 + [l3/2]*30
quarantine_list = [q1/2]*30 + [q2/2]*30 + [q3/2]*30
susc, exp, inf, rec, d, re, policy,cont_tracing = virus_model(hygiene_list, distancing_list,lockdown_list,quarantine_list)
point = evaluate(inf, rec, d, policy,cont_tracing)
m = [m for m in range(91)]
plt.plot(m, point, label=legends[i], alpha = al[i], color = col[i])
plt.plot()
plt.legend(loc = 'upper left', fontsize = 20)
plt.ylim([10**9, 10**12])
plt.xlim([0, 91])
plt.xlabel('Day(s) from start', fontsize = 20)
plt.ylabel('Loss ($)', fontsize = 20)
sns.despine()
plt.rcParams["figure.figsize"] = (10, 10)
plt.tick_params(labelsize=20)
plt.savefig('./content/sample_data/loss.pdf')
# Code abbreviations
res = []
keys = ['M', 'D', 'L', 'T']
for i,indice in enumerate(index):
h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3 = indice
hygiene_list = [h1/2]*30 + [h2/2]*30 + [h3/2]*30
distancing_list = [d1/2]*30 + [d2/2]*30 + [d3/2]*30
lockdown_list = [l1/2]*30 + [l2/2]*30 + [l3/2]*30
quarantine_list = [q1/2]*30 + [q2/2]*30 + [q3/2]*30
susc, exp, inf, rec, d, re, policy,cont_tracing = virus_model(hygiene_list, distancing_list,lockdown_list,quarantine_list)
point = evaluate(inf, rec, d, policy,cont_tracing)
print(point)
label = ''
for i in [0, 3, 6, 9]:
if indice[i] == 2:
label += keys[i//3]
if indice[i] == 1:
label += keys[i//3].lower()
if sum([indice[i] for i in [0, 3, 6, 9]]) == 0:
label += '-'
label += ' | '
for i in [1, 4, 7, 10]:
if indice[i] == 2:
label += keys[i//3]
if indice[i] == 1:
label += keys[i//3].lower()
if sum([indice[i] for i in [1, 4, 7, 10]]) == 0:
label += '-'
label += ' | '
for i in [2, 5, 8, 11]:
if indice[i] == 2:
label += keys[i//3]
if indice[i] == 1:
label += keys[i//3].lower()
if sum([indice[i] for i in [2, 5, 8, 11]]) == 0:
label += '-'
res.append([label, int(1000000-susc[-1]), int(d[-1]), point[-1]/1000000000])
[-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13798001517.133377, 14734044469.007896, 15717733294.09704, 16750923861.323364, 17835513358.30278, 18973438047.40031, 20166670622.162304, 21417217138.044987, 22727113491.241478, 24098421419.742825, 25533224001.568817, 27033620626.39734, 28601721418.640667, 30239641092.40032, 31949492221.718967, 33733377913.174995, 35593383872.168655, 37531569859.25571, 39549960538.61687, 41650535727.21853, 43835220060.41985, 46105872097.69389, 48464272900.72205, 50912114125.33215, 53450985678.5054, 56082363001.872955, 58807594053.63102, 61627886071.472855, 64544292209.78891, 67557698154.818344, 70668808831.42566, 73878135324.47755, 77185982146.15268, 80592434987.66104, 84097349099.51114, 87700338448.37553, 91400765800.51762, 95197733881.4246, 99090077758.5454, 103076358588.70189, 107154858863.72156, 111323579277.08357, 115580237320.89357, 119922267706.4011, 124346824682.70491, 128850786307.49924, 133430760701.00723, 138083094290.00644, 142803882023.51147, 147588979515.73682, 152434017045.93054, 157334415319.1069, 162285402867.15317, 167282034946.788, 172319213769.91507, 177391709883.50772, 182494184500.68335, 187621212572.41122, 192767306380.5876, 197926939428.16144] [-0.0, 245048989.58971217, 474678582.1668743, 694564234.1299728, 908827502.9686524, 1120471515.736162, 1331694487.7262225, 1544115486.0044446, 1758937026.1693933, 1977062191.1459749, 2199179001.5941753, 2425821201.007304, 2657412052.6091228, 2894295898.4806285, 3136760902.0151505, 3386429217.295379, 3644701496.548492, 3911851509.750855, 4188134297.4550037, 4473792265.342671, 4769059566.896021, 5074165251.570814, 5389335522.205052, 5714795349.158036, 6050769619.370953, 6397483948.629174, 6755165249.359759, 7124042120.406008, 7504345106.570829, 7896306862.28569, 8300162244.082963, 8716148349.576406, 9144504515.630417, 9585472284.778759, 10039295346.345646, 10506219456.843365, 10986492342.867598, 11480363588.738007, 11988084510.431232, 12509908016.850794, 13046088459.118399, 13596881468.314281, 14162543781.91251, 14743333059.029547, 15339507684.516796, 15951326561.869083, 16579048894.88411, 17222933957.98667, 17883240855.122643, 18560228267.128124, 19254154187.486774, 19965275646.401875, 20693848423.128265, 21440126746.531517, 22204362983.868008, 22986807317.80871, 23787707411.761826, 24607308063.584297, 25445850847.80976, 26303573746.56061, 27180710769.354073, 28077491562.056923, 28994141005.29018, 29930878802.633976, 30887919059.033535, 31865469849.859943, 32863732781.133316, 33882902541.47219, 34923166446.38965, 35984703975.6153, 37067686304.1812, 38172275828.06973, 39298625685.281784, 40446879273.244, 41617169763.53404, 42809619614.96272, 44024340086.11088, 45261430748.47631, 46520979001.44277, 47803059590.33671, 49107734128.88972, 50435050627.473564, 51785043028.520164, 53157730750.58153, 54553118242.52209, 55971194549.36984, 57411932891.380516, 58875290257.89248, 60361207017.56687, 61869606546.618385, 63400394876.646034] [-0.0, 247158578.6308081, 478897760.2490661, 697940458.922738, 906394473.5229197, 1105895105.8490422, 1297714628.7710721, 1482846314.054439, 1662068935.4889426, 1835996286.72249, 2005115197.3668401, 2169814720.8297157, 2330408545.7004013, 2487152205.488843, 2640256295.4350667, 2789896624.1509013, 2936222012.2253084, 3079360284.4241285, 3219422875.086433, 3356508368.817269, 3490705223.7355375, 3622093867.0877976, 3750748308.940924, 3876737385.8156548, 4000125720.1376657, 4120974461.4349017, 4239341859.8964596, 4355283711.152503, 4468853702.109793, 4580103680.748927, 4689083867.470388, 4795843021.492768, 4900428572.671519, 5002886726.699571, 5103262549.80313, 5201600037.627284, 5297942171.916592, 5392330967.759606, 5484807513.524079, 5575412005.116559, 5664183775.821579, 5751161322.6849985, 5836382330.182849, 5919883691.745705, 6001701529.577112, 6081871213.103447, 6160427376.315174, 6237403934.19978, 6312834098.421038, 6386750392.364075, 6459184665.638777, 6530168108.113375, 6599731263.534131, 6667904042.774858, 6734715736.750604, 6800195029.022635, 6864370008.116372, 6927268179.569537, 6988916477.724699, 7049341277.277708, 7108568404.591674, 7166623148.784645, 7223530272.597934, 7279314023.051246, 7333998141.889957, 7387605875.829473, 7440159986.601092, 7491682760.803522, 7542196019.563924, 7591721128.012127, 7640279004.571575, 7687890130.070305, 7734574556.675282, 7780351916.653227, 7825241430.961033, 7869261917.668789, 7912431800.218404, 7954769115.520691, 7996291521.893814, 8037016306.845902, 8076960394.704568, 8116140354.096125, 8154572405.27711, 8192272427.320845, 8229255965.161582, 8265538236.498845, 8301134138.564488, 8336058254.754983, 8370324861.131384, 8403947932.789425, 8436941150.102107] [-0.0, 251268167.67190397, 487116938.3312579, 708792954.8807644, 917395795.7548594, 1113901582.9585838, 1299182220.2156112, 1474021109.6115155, 1639126028.0744545, 1795139711.0140672, 1942648582.9047377, 2082189988.309864, 2214258207.5954046, 2339309486.002107, 2457766260.1322675, 2570020730.089738, 2676437896.751583, 2777358160.551065, 2873099559.595393, 2963959710.0301766, 3050217499.575957, 3132134575.5227456, 3209956660.713124, 3283914724.801377, 3354226033.0472436, 3421095090.8489847, 3484714498.9497294, 3545265731.6094217, 3602919847.8987117, 3657838144.5415697, 3710172757.330776, 3760067217.0008235, 3807656964.5149374, 3853069829.9656863, 3896426478.6689644, 3937840827.522485, 3977420434.280862, 4015266862.052939, 4051476021.0392184, 4086138489.287224, 4119339814.0412297, 4151160795.093027, 4181677751.396332, 4210962772.084541, 4239083952.9258757, 4266105619.158697, 4292088535.5701885, 4317090104.612002, 4341164553.284945, 4364363109.470216, 4386734168.335945, 4408323449.403962, 4429174144.822115, 4449327059.351516, 4468820742.545246, 4487691613.564981, 4505974079.054348, 4523700644.462241, 4540902019.185686, 4557607215.879914, 4573843644.262771, 4589637199.721639, 4605012347.013113, 4619992199.32909, 4634598592.9872675, 4648852157.989363, 4662772384.676658, 4676377686.699454, 4689685460.5049305, 4702712141.536334, 4715473257.325753, 4727983477.652466, 4740256661.929274, 4752305903.970263, 4764143574.28481, 4775781360.034673, 4787230302.783382, 4798500834.160001, 4809602809.552528, 4820545539.939872, 4831337821.965265, 4841987966.348293, 4852503824.72736, 4862892815.019303, 4873161945.378104, 4883317836.830077, 4893366744.658675, 4903314578.607989, 4913166921.970185, 4922929049.618566, 4932605945.0444765] [-0.0, 247531056.27930775, 479619064.4905197, 697512581.8174378, 902312874.9818969, 1094997564.5731401, 1276439892.7661135, 1447424464.1204693, 1608660141.8507423, 1760790647.7303653, 1904403306.0919688, 2040036285.9641097, 2168184626.029638, 2289305271.4265804, 2403821306.73025, 2512125533.5830746, 2614583512.634149, 2711536166.316257, 2803302020.403374, 2890179147.35725, 2972446862.466685, 3050367214.1288514, 3124186301.8547554, 3194135449.3282237, 3260432254.8112082, 3323281537.1280994, 3382876192.1859403, 3439397972.3417883, 3493018198.7891555, 3543898415.403289, 3592190991.080228, 3638039676.4632335, 3681580120.02093, 3722940347.6830716, 3762241209.6192465, 3799596797.236367, 3835114833.051122, 3868897035.746575, 3901039462.433898, 3931632829.8997836, 3960762816.4184175, 3988510345.5368223, 4014951853.0981536, 4040159538.6443715, 4064201602.233954, 4087142467.618854, 4109042992.645259, 4129960667.6729307, 4149949802.7463655, 4169061704.196301, 4187344841.301299, 4204845003.5952253, 4221605449.3667984, 4237667045.861344, 4253068401.662043, 4267845991.697804, 4282034275.2972217, 4295665807.682451, 4308771345.273157, 4321379945.148725, 4333519058.996376, 4345214621.853818, 4356491135.9371395, 4367371749.828005, 4377878333.2785635, 4388031547.877741, 4397850913.808871, 4407354872.915603, 4416560848.280859, 4425485300.512111, 4434143780.915454, 4442550981.730769, 4450720783.590637, 4458666300.356652, 4466399921.478192, 4473933352.010708, 4481277650.422916, 4488443264.315169, 4495440064.164461, 4502277375.205141, 4508964007.548376, 4515508284.637691, 4521918070.132529, 4528200793.306709, 4534363473.043811, 4540412740.507027, 4546354860.556712, 4552195751.984818, 4557941006.6315565, 4563595907.446076, 4569165445.549441] [-0.0, 249419312.98475784, 483402677.5247325, 703117465.4684967, 909609357.8246578, 1103820006.925323, 1286601597.2803679, 1458728891.4257712, 1620909233.5503457, 1773790892.3053148, 1917970050.633398, 2053996691.2175245, 2182379578.443944, 2303590499.347951, 2418067895.050499, 2526219989.2430916, 2628427500.1635838, 2725046006.2836213, 2816408022.8401513, 2902824835.7780886, 2984588131.1375628, 3061971451.0215516, 3135231501.700263, 3204609334.891108, 3270331419.5915756, 3332610618.8709292, 3391647083.6117926, 3447629073.227143, 3500733711.775143, 3551127686.584256, 3598967895.427856, 3642420097.326091, 3683604280.9914293, 3722664504.331321, 3759733149.8394246, 3794932305.6114063, 3828374924.350691, 3860165801.476475, 3890402405.464271, 3919175587.1386995, 3946570189.4885855, 3972665575.436483, 3997536087.6686764, 4021251451.9571686, 4043877133.253607, 4065474652.1032915, 4086101867.5325956, 4105813231.439046, 4124660018.6064143, 4142690535.7350354, 4159950312.285692, 4176482275.456272, 4192326911.2220654, 4207522413.0551786, 4222104819.68183, 4236108143.0270348, 4249564487.3249445, 4262504160.232708, 4274955776.6701894, 4286946356.012393, 4298501413.182261, 4309645044.125553, 4320400006.094192, 4330787793.117973, 4340828707.005076, 4350541924.178252, 4359945558.624731, 4369056721.213031, 4377891575.608244, 4386465390.99847, 4394792591.828379, 4402886804.721182, 4410760902.757066, 4418427047.264371, 4425896727.269116, 4433180796.738791, 4440289509.747552, 4447232553.681869, 4454019080.5982485, 4460657736.837844, 4467156690.996427, 4473523660.342274, 4479765935.769167, 4485890405.366501, 4491903576.683805, 4497811597.762516, 4503620277.003676, 4509335101.936328, 4514961256.947678, 4520503640.032709, 4525966878.6176195]
Table represents loss regarding applied policies. The most effective policy combination is listed at the top. The meaning of policy notatioin is as follows:
None: Doing nothing
Uppercase: full efficacy
Lowercase: half efficacy
L/l: Lockdown
T/t: Tracing with distancing
D/d: Distancing
M/m: Masks and Hygiene
Example: L | l | D denotes the consecutive policy execution of full lockdown (1st month), half lockdown (2nd month) and full distancing (3rd month).
df = pd.DataFrame(res, columns = ['Policy combination', 'Cases', 'Deaths', 'Loss'])
df = df.set_index('Policy combination')
df.sort_values(by='Loss')
Cases | Deaths | Loss | |
---|---|---|---|
Policy combination | |||
MT | T | T | 10734 | 577 | 4.525967 |
T | T | T | 11003 | 591 | 4.569165 |
L | L | L | 11003 | 591 | 4.932606 |
D | D | D | 22478 | 1138 | 8.436941 |
M | M | M | 201929 | 8941 | 63.400395 |
- | - | - | 592136 | 28018 | 197.926939 |
# For more results:
def k_largest_index_argsort(a, k):
idx = np.argsort(a.ravel())[-k:]
return np.column_stack(np.unravel_index(idx, a.shape))
def k_smallest_index_argsort(a, k):
idx = np.argsort(a.ravel())[:k]
return np.column_stack(np.unravel_index(idx, a.shape))
x = result
# Choose bottom k combinations
k = 5
idx = k_smallest_index_argsort(x, k)
index.extend(idx.tolist())
# Choose top n combinations
n = 5
idx = k_largest_index_argsort(x, n)
index.extend(idx.tolist())
res = []
keys = ['M', 'D', 'L', 'T']
for i,indice in enumerate(index):
h1, h2, h3, d1, d2, d3, l1, l2, l3, q1, q2, q3 = indice
hygiene_list = [h1/2]*30 + [h2/2]*30 + [h3/2]*30
distancing_list = [d1/2]*30 + [d2/2]*30 + [d3/2]*30
lockdown_list = [l1/2]*30 + [l2/2]*30 + [l3/2]*30
quarantine_list = [q1/2]*30 + [q2/2]*30 + [q3/2]*30
susc, exp, inf, rec, d, re, policy,cont_tracing = virus_model(hygiene_list, distancing_list,lockdown_list,quarantine_list)
point = evaluate(inf, rec, d, policy,cont_tracing)
print(point)
label = ''
for i in [0, 3, 6, 9]:
if indice[i] == 2:
label += keys[i//3]
if indice[i] == 1:
label += keys[i//3].lower()
if sum([indice[i] for i in [0, 3, 6, 9]]) == 0:
label += '-'
label += ' | '
for i in [1, 4, 7, 10]:
if indice[i] == 2:
label += keys[i//3]
if indice[i] == 1:
label += keys[i//3].lower()
if sum([indice[i] for i in [1, 4, 7, 10]]) == 0:
label += '-'
label += ' | '
for i in [2, 5, 8, 11]:
if indice[i] == 2:
label += keys[i//3]
if indice[i] == 1:
label += keys[i//3].lower()
if sum([indice[i] for i in [2, 5, 8, 11]]) == 0:
label += '-'
res.append([label, int(1000000-susc[-1]), int(d[-1]), point[-1]/1000000000])
[-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13798001517.133377, 14734044469.007896, 15717733294.09704, 16750923861.323364, 17835513358.30278, 18973438047.40031, 20166670622.162304, 21417217138.044987, 22727113491.241478, 24098421419.742825, 25533224001.568817, 27033620626.39734, 28601721418.640667, 30239641092.40032, 31949492221.718967, 33733377913.174995, 35593383872.168655, 37531569859.25571, 39549960538.61687, 41650535727.21853, 43835220060.41985, 46105872097.69389, 48464272900.72205, 50912114125.33215, 53450985678.5054, 56082363001.872955, 58807594053.63102, 61627886071.472855, 64544292209.78891, 67557698154.818344, 70668808831.42566, 73878135324.47755, 77185982146.15268, 80592434987.66104, 84097349099.51114, 87700338448.37553, 91400765800.51762, 95197733881.4246, 99090077758.5454, 103076358588.70189, 107154858863.72156, 111323579277.08357, 115580237320.89357, 119922267706.4011, 124346824682.70491, 128850786307.49924, 133430760701.00723, 138083094290.00644, 142803882023.51147, 147588979515.73682, 152434017045.93054, 157334415319.1069, 162285402867.15317, 167282034946.788, 172319213769.91507, 177391709883.50772, 182494184500.68335, 187621212572.41122, 192767306380.5876, 197926939428.16144] [-0.0, 245048989.58971217, 474678582.1668743, 694564234.1299728, 908827502.9686524, 1120471515.736162, 1331694487.7262225, 1544115486.0044446, 1758937026.1693933, 1977062191.1459749, 2199179001.5941753, 2425821201.007304, 2657412052.6091228, 2894295898.4806285, 3136760902.0151505, 3386429217.295379, 3644701496.548492, 3911851509.750855, 4188134297.4550037, 4473792265.342671, 4769059566.896021, 5074165251.570814, 5389335522.205052, 5714795349.158036, 6050769619.370953, 6397483948.629174, 6755165249.359759, 7124042120.406008, 7504345106.570829, 7896306862.28569, 8300162244.082963, 8716148349.576406, 9144504515.630417, 9585472284.778759, 10039295346.345646, 10506219456.843365, 10986492342.867598, 11480363588.738007, 11988084510.431232, 12509908016.850794, 13046088459.118399, 13596881468.314281, 14162543781.91251, 14743333059.029547, 15339507684.516796, 15951326561.869083, 16579048894.88411, 17222933957.98667, 17883240855.122643, 18560228267.128124, 19254154187.486774, 19965275646.401875, 20693848423.128265, 21440126746.531517, 22204362983.868008, 22986807317.80871, 23787707411.761826, 24607308063.584297, 25445850847.80976, 26303573746.56061, 27180710769.354073, 28077491562.056923, 28994141005.29018, 29930878802.633976, 30887919059.033535, 31865469849.859943, 32863732781.133316, 33882902541.47219, 34923166446.38965, 35984703975.6153, 37067686304.1812, 38172275828.06973, 39298625685.281784, 40446879273.244, 41617169763.53404, 42809619614.96272, 44024340086.11088, 45261430748.47631, 46520979001.44277, 47803059590.33671, 49107734128.88972, 50435050627.473564, 51785043028.520164, 53157730750.58153, 54553118242.52209, 55971194549.36984, 57411932891.380516, 58875290257.89248, 60361207017.56687, 61869606546.618385, 63400394876.646034] [-0.0, 247158578.6308081, 478897760.2490661, 697940458.922738, 906394473.5229197, 1105895105.8490422, 1297714628.7710721, 1482846314.054439, 1662068935.4889426, 1835996286.72249, 2005115197.3668401, 2169814720.8297157, 2330408545.7004013, 2487152205.488843, 2640256295.4350667, 2789896624.1509013, 2936222012.2253084, 3079360284.4241285, 3219422875.086433, 3356508368.817269, 3490705223.7355375, 3622093867.0877976, 3750748308.940924, 3876737385.8156548, 4000125720.1376657, 4120974461.4349017, 4239341859.8964596, 4355283711.152503, 4468853702.109793, 4580103680.748927, 4689083867.470388, 4795843021.492768, 4900428572.671519, 5002886726.699571, 5103262549.80313, 5201600037.627284, 5297942171.916592, 5392330967.759606, 5484807513.524079, 5575412005.116559, 5664183775.821579, 5751161322.6849985, 5836382330.182849, 5919883691.745705, 6001701529.577112, 6081871213.103447, 6160427376.315174, 6237403934.19978, 6312834098.421038, 6386750392.364075, 6459184665.638777, 6530168108.113375, 6599731263.534131, 6667904042.774858, 6734715736.750604, 6800195029.022635, 6864370008.116372, 6927268179.569537, 6988916477.724699, 7049341277.277708, 7108568404.591674, 7166623148.784645, 7223530272.597934, 7279314023.051246, 7333998141.889957, 7387605875.829473, 7440159986.601092, 7491682760.803522, 7542196019.563924, 7591721128.012127, 7640279004.571575, 7687890130.070305, 7734574556.675282, 7780351916.653227, 7825241430.961033, 7869261917.668789, 7912431800.218404, 7954769115.520691, 7996291521.893814, 8037016306.845902, 8076960394.704568, 8116140354.096125, 8154572405.27711, 8192272427.320845, 8229255965.161582, 8265538236.498845, 8301134138.564488, 8336058254.754983, 8370324861.131384, 8403947932.789425, 8436941150.102107] [-0.0, 251268167.67190397, 487116938.3312579, 708792954.8807644, 917395795.7548594, 1113901582.9585838, 1299182220.2156112, 1474021109.6115155, 1639126028.0744545, 1795139711.0140672, 1942648582.9047377, 2082189988.309864, 2214258207.5954046, 2339309486.002107, 2457766260.1322675, 2570020730.089738, 2676437896.751583, 2777358160.551065, 2873099559.595393, 2963959710.0301766, 3050217499.575957, 3132134575.5227456, 3209956660.713124, 3283914724.801377, 3354226033.0472436, 3421095090.8489847, 3484714498.9497294, 3545265731.6094217, 3602919847.8987117, 3657838144.5415697, 3710172757.330776, 3760067217.0008235, 3807656964.5149374, 3853069829.9656863, 3896426478.6689644, 3937840827.522485, 3977420434.280862, 4015266862.052939, 4051476021.0392184, 4086138489.287224, 4119339814.0412297, 4151160795.093027, 4181677751.396332, 4210962772.084541, 4239083952.9258757, 4266105619.158697, 4292088535.5701885, 4317090104.612002, 4341164553.284945, 4364363109.470216, 4386734168.335945, 4408323449.403962, 4429174144.822115, 4449327059.351516, 4468820742.545246, 4487691613.564981, 4505974079.054348, 4523700644.462241, 4540902019.185686, 4557607215.879914, 4573843644.262771, 4589637199.721639, 4605012347.013113, 4619992199.32909, 4634598592.9872675, 4648852157.989363, 4662772384.676658, 4676377686.699454, 4689685460.5049305, 4702712141.536334, 4715473257.325753, 4727983477.652466, 4740256661.929274, 4752305903.970263, 4764143574.28481, 4775781360.034673, 4787230302.783382, 4798500834.160001, 4809602809.552528, 4820545539.939872, 4831337821.965265, 4841987966.348293, 4852503824.72736, 4862892815.019303, 4873161945.378104, 4883317836.830077, 4893366744.658675, 4903314578.607989, 4913166921.970185, 4922929049.618566, 4932605945.0444765] [-0.0, 247531056.27930775, 479619064.4905197, 697512581.8174378, 902312874.9818969, 1094997564.5731401, 1276439892.7661135, 1447424464.1204693, 1608660141.8507423, 1760790647.7303653, 1904403306.0919688, 2040036285.9641097, 2168184626.029638, 2289305271.4265804, 2403821306.73025, 2512125533.5830746, 2614583512.634149, 2711536166.316257, 2803302020.403374, 2890179147.35725, 2972446862.466685, 3050367214.1288514, 3124186301.8547554, 3194135449.3282237, 3260432254.8112082, 3323281537.1280994, 3382876192.1859403, 3439397972.3417883, 3493018198.7891555, 3543898415.403289, 3592190991.080228, 3638039676.4632335, 3681580120.02093, 3722940347.6830716, 3762241209.6192465, 3799596797.236367, 3835114833.051122, 3868897035.746575, 3901039462.433898, 3931632829.8997836, 3960762816.4184175, 3988510345.5368223, 4014951853.0981536, 4040159538.6443715, 4064201602.233954, 4087142467.618854, 4109042992.645259, 4129960667.6729307, 4149949802.7463655, 4169061704.196301, 4187344841.301299, 4204845003.5952253, 4221605449.3667984, 4237667045.861344, 4253068401.662043, 4267845991.697804, 4282034275.2972217, 4295665807.682451, 4308771345.273157, 4321379945.148725, 4333519058.996376, 4345214621.853818, 4356491135.9371395, 4367371749.828005, 4377878333.2785635, 4388031547.877741, 4397850913.808871, 4407354872.915603, 4416560848.280859, 4425485300.512111, 4434143780.915454, 4442550981.730769, 4450720783.590637, 4458666300.356652, 4466399921.478192, 4473933352.010708, 4481277650.422916, 4488443264.315169, 4495440064.164461, 4502277375.205141, 4508964007.548376, 4515508284.637691, 4521918070.132529, 4528200793.306709, 4534363473.043811, 4540412740.507027, 4546354860.556712, 4552195751.984818, 4557941006.6315565, 4563595907.446076, 4569165445.549441] [-0.0, 249419312.98475784, 483402677.5247325, 703117465.4684967, 909609357.8246578, 1103820006.925323, 1286601597.2803679, 1458728891.4257712, 1620909233.5503457, 1773790892.3053148, 1917970050.633398, 2053996691.2175245, 2182379578.443944, 2303590499.347951, 2418067895.050499, 2526219989.2430916, 2628427500.1635838, 2725046006.2836213, 2816408022.8401513, 2902824835.7780886, 2984588131.1375628, 3061971451.0215516, 3135231501.700263, 3204609334.891108, 3270331419.5915756, 3332610618.8709292, 3391647083.6117926, 3447629073.227143, 3500733711.775143, 3551127686.584256, 3598967895.427856, 3642420097.326091, 3683604280.9914293, 3722664504.331321, 3759733149.8394246, 3794932305.6114063, 3828374924.350691, 3860165801.476475, 3890402405.464271, 3919175587.1386995, 3946570189.4885855, 3972665575.436483, 3997536087.6686764, 4021251451.9571686, 4043877133.253607, 4065474652.1032915, 4086101867.5325956, 4105813231.439046, 4124660018.6064143, 4142690535.7350354, 4159950312.285692, 4176482275.456272, 4192326911.2220654, 4207522413.0551786, 4222104819.68183, 4236108143.0270348, 4249564487.3249445, 4262504160.232708, 4274955776.6701894, 4286946356.012393, 4298501413.182261, 4309645044.125553, 4320400006.094192, 4330787793.117973, 4340828707.005076, 4350541924.178252, 4359945558.624731, 4369056721.213031, 4377891575.608244, 4386465390.99847, 4394792591.828379, 4402886804.721182, 4410760902.757066, 4418427047.264371, 4425896727.269116, 4433180796.738791, 4440289509.747552, 4447232553.681869, 4454019080.5982485, 4460657736.837844, 4467156690.996427, 4473523660.342274, 4479765935.769167, 4485890405.366501, 4491903576.683805, 4497811597.762516, 4503620277.003676, 4509335101.936328, 4514961256.947678, 4520503640.032709, 4525966878.6176195] [-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13798001517.133377, 14734044469.007896, 15717733294.09704, 16750923861.323364, 17835513358.30278, 18973438047.40031, 20166670622.162304, 21417217138.044987, 22727113491.241478, 24098421419.742825, 25533224001.568817, 27033620626.39734, 28601721418.640667, 30239641092.40032, 31949492221.718967, 33733377913.174995, 35593383872.168655, 37531569859.25571, 39549960538.61687, 41650535727.21853, 43835220060.41985, 46105872097.69389, 48464272900.72205, 50912114125.33215, 53450985678.5054, 56082363001.872955, 58807594053.63102, 61627886071.472855, 64544292209.78891, 67557698154.818344, 70668808831.42566, 73878135324.47755, 77185982146.15268, 80592434987.66104, 84097349099.51114, 87700338448.37553, 91400765800.51762, 95197733881.4246, 99090077758.5454, 103076358588.70189, 107154858863.72156, 111323579277.08357, 115580237320.89357, 119922267706.4011, 124346824682.70491, 128850786307.49924, 133430760701.00723, 138083094290.00644, 142803882023.51147, 147588979515.73682, 152434017045.93054, 157334415319.1069, 162285402867.15317, 167282034946.788, 172319213769.91507, 177391709883.50772, 182494184500.68335, 187621212572.41122, 192767306380.5876, 197926939428.16144] [-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13798001517.133377, 14734044469.007896, 15717733294.09704, 16750923861.323364, 17835513358.30278, 18973438047.40031, 20166670622.162304, 21417217138.044987, 22727113491.241478, 24098421419.742825, 25533224001.568817, 27033620626.39734, 28601721418.640667, 30239641092.40032, 31949492221.718967, 33733377913.174995, 35593383872.168655, 37531569859.25571, 39549960538.61687, 41650535727.21853, 43835220060.41985, 46105872097.69389, 48464272900.72205, 50912114125.33215, 53450985678.5054, 56082363001.872955, 58807594053.63102, 61627886071.472855, 64544292209.78891, 67557698154.818344, 70669808831.42566, 73880135324.47755, 77179261065.96494, 80559982287.97969, 84016651178.60646, 87544703009.55304, 91140315768.95944, 94800165332.39026, 98521249614.66812, 102300762616.10294, 106136004637.92787, 110024318789.306, 113963046669.90787, 117949498094.6378, 121980931150.64209, 126054539899.0504, 130167447768.13928, 134316705211.95909, 138499290587.2057, 142712113473.11475, 146952019854.4926, 151215798728.3133, 155500189795.1893, 159801891969.6741, 164117572495.86783, 168443876492.9935, 172777436783.6913, 177114883878.7564, 181452856008.0961, 185788009100.35098] [-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13798001517.133377, 14734044469.007896, 15717733294.09704, 16750923861.323364, 17835513358.30278, 18973438047.40031, 20166670622.162304, 21417217138.044987, 22727113491.241478, 24098421419.742825, 25533224001.568817, 27033620626.39734, 28601721418.640667, 30239641092.40032, 31949492221.718967, 33733377913.174995, 35593383872.168655, 37531569859.25571, 39549960538.61687, 41650535727.21853, 43835220060.41985, 46105872097.69389, 48464272900.72205, 50912114125.33215, 53450985678.5054, 56082363001.872955, 58807594053.63102, 61627886071.472855, 64544292209.78891, 67557698154.818344, 70670808831.42566, 73882135324.47755, 77172539985.77722, 80527488549.61902, 83935812597.30675, 87388803888.40732, 90879551615.02083, 94402457506.19757, 97952881184.02214, 101526880953.27373, 105121024549.30666, 108732251197.26785, 112357771326.8054, 115994993935.21466, 119641474260.3867, 123294876377.24167, 126952946760.47002, 130613495903.19386, 134274385848.41585, 137933522052.91113, 141588848416.3829, 145238344612.31656, 148880025080.3258, 152511939204.3218, 156132172322.22833, 159738847302.7018, 163330126490.7975, 166904213873.9254, 170459357356.27057, 173993851057.43658] [-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13798001517.133377, 14734044469.007896, 15717733294.09704, 16750923861.323364, 17835513358.30278, 18973438047.40031, 20166670622.162304, 21417217138.044987, 22727113491.241478, 24098421419.742825, 25533224001.568817, 27033620626.39734, 28601721418.640667, 30239641092.40032, 31949492221.718967, 33733377913.174995, 35593383872.168655, 37531569859.25571, 39549960538.61687, 41650535727.21853, 43835220060.41985, 46105872097.69389, 48464272900.72205, 50912114125.33215, 53450985678.5054, 56082363001.872955, 58807594053.63102, 61627886071.472855, 64544292209.78891, 67557698154.818344, 70670863625.9462, 73882244913.51865, 77168167865.25124, 80510663272.1182, 83895980556.2265, 87313490657.92323, 90754876177.93333, 94213533539.3833, 97684131665.67072, 101162286230.44499, 104644319273.64043, 108127081893.65442, 111607823561.4126, 115084095904.49077, 118553681982.30836, 122014544414.07669, 125464787448.70293, 128902629341.48816, 132326382344.95007, 135734438317.88245, 139125258472.238, 142497366159.04117, 145849341877.28278, 149179819899.40958, 152487486062.64008, 155771076390.9536, 159029376298.594, 162261220189.9727, 165465491318.6121, 168641121803.44186] [-0.0, 243048989.58971217, 470678582.1668743, 690577331.1735109, 908237760.8551673, 1127633311.3754811, 1351688723.9838376, 1582607088.6732883, 1822097374.9588842, 2074236122.0474293, 2342150151.2319617, 2627239907.0491276, 2930770376.0273614, 3253924474.7595596, 3597840495.176862, 3963638463.533936, 4352438784.206866, 4765375507.530481, 5203605843.889663, 5668317047.890548, 6160731449.867514, 6682110170.847734, 7233755889.18961, 7817014910.067934, 8433278707.264355, 9083985049.549042, 9770618783.818312, 10494712318.882685, 11257845833.772503, 12061647220.14198, 12907791758.07521, 13799001517.133377, 14736044469.007896, 15716890252.540201, 16740384397.846804, 17805995252.717403, 18913633846.03597, 20063525448.20424, 21256117765.199497, 22492015083.23157, 23771930787.016285, 25096652877.14262, 26467018673.88387, 27883896002.598343, 29348168941.799686, 30860726772.766685, 32422455165.626453, 34034228918.257126, 35696905764.481575, 37411320910.51043, 39178282060.20679, 40998564762.36877, 42872907965.28647, 44802009701.2982, 46786522851.18021, 48827050957.95309, 50924144074.19984, 53078294637.76536, 55289933378.80532, 57559425267.31812, 59887065515.04996, 62272075649.37359, 64715599679.65651, 67225731789.39372, 69808464184.12128, 72468259038.0773, 75208449164.96951, 78031518035.97694, 80939294775.60097, 83933089250.66473, 87013784982.824, 90181902422.68701, 93437641469.33551, 96780909544.59508, 100211339715.7542, 103728302078.25357, 107330910702.8483, 111018027808.56802, 114788266365.12686, 118639992001.11389, 122571324858.49226, 126580141862.30748, 130664079747.81981, 134820539092.03023, 139046689523.3034, 143339476224.92947, 147695627801.45074, 152111665537.31744, 156583914043.83157, 161108513261.05176, 165681431755.4983] [-0.0, 248161723.11822093, 480772238.417906, 701809337.4067808, 914239246.2736205, 1120273707.7915533, 1321561690.5955443, 1519332362.2069383, 1714501723.573663, 1907752146.1550138, 2099591700.7561615, 2290398414.703836, 2480453287.6116886, 2669964922.119674, 2859087899.8934503, 3047936491.745762, 3236594886.9880214, 3425124826.0091, 3613571295.5022864, 3801966778.2579684, 3990334424.4987807, 4178690418.536488, 4367045745.008031, 4555407507.085466, 4743779910.363979, 4932164997.2673025, 5120563195.274701, 5308973726.206316, 5497394911.815594, 5685824401.992684, 5874259345.208261, 6068454832.566689, 6262649798.543973, 6454734296.635365, 6643132611.5309105, 6826692201.386786, 7004594630.349562, 7176284197.616697, 7341410804.182449, 7499784271.16036, 7651337865.66214, 7796099227.01052, 7934167238.01065, 8065693669.573333, 8190868655.449379, 8309909237.896013, 8423050373.375625, 8530537906.832494, 8632623119.30399, 8729558531.111578, 8821594705.280529, 8908977846.08594, 8991948028.0781, 9070737923.5057, 9145571922.264336, 9216665559.586063, 9284225183.649172, 9348447808.928656, 9409521112.07298, 9467623535.903557, 9522924474.20877, 9575624067.752695, 9625832510.767157, 9673750881.918901, 9719554575.683784, 9763397769.250172, 9805417018.506598, 9845734158.393087, 9884458647.334402, 9921689467.141487, 9957516667.194235, 9992022623.732988, 10025283070.755123, 10057367947.593382, 10088342099.152143, 10118265857.525303, 10147195527.938557, 10175183797.3513, 10202280080.379593, 10228530814.272718, 10253979712.339958, 10278667983.360796, 10302634523.025331, 10325916082.264904, 10348547416.385782, 10370561418.16199, 10391989237.438667, 10412860389.31369, 10433202852.578514, 10453043159.788996, 10472406480.088757] [-0.0, 248161723.11822093, 480772238.417906, 701809337.4067808, 914239246.2736205, 1120273707.7915533, 1321561690.5955443, 1519332362.2069383, 1714501723.573663, 1907752146.1550138, 2099591700.7561615, 2290398414.703836, 2480453287.6116886, 2669964922.119674, 2859087899.8934503, 3047936491.745762, 3236594886.9880214, 3425124826.0091, 3613571295.5022864, 3801966778.2579684, 3990334424.4987807, 4178690418.536488, 4367045745.008031, 4555407507.085466, 4743779910.363979, 4932164997.2673025, 5120563195.274701, 5308973726.206316, 5497394911.815594, 5685824401.992684, 5874259345.208261, 6068454832.566689, 6262649798.543973, 6454734296.635365, 6643132611.5309105, 6826692201.386786, 7004594630.349562, 7176284197.616697, 7341410804.182449, 7499784271.16036, 7651337865.66214, 7796099227.01052, 7934167238.01065, 8065693669.573333, 8190868655.449379, 8309909237.896013, 8423050373.375625, 8530537906.832494, 8632623119.30399, 8729558531.111578, 8821594705.280529, 8908977846.08594, 8991948028.0781, 9070737923.5057, 9145571922.264336, 9216665559.586063, 9284225183.649172, 9348447808.928656, 9409521112.07298, 9467623535.903557, 9522924474.20877, 9573513102.646114, 9621613879.73341, 9667502345.186886, 9711405076.40929, 9753509781.769049, 9793973247.665668, 9832927598.412216, 9870485229.681171, 9906742699.024504, 9941783796.283966, 9975681969.010683, 10008502240.530344, 10040302728.834032, 10071135851.326073, 10101049282.268366, 10130086715.46382, 10158288473.485914, 10185691995.931145, 10212332232.231258, 10238241959.108059, 10263452038.46665, 10287991628.153744, 10311888355.359303, 10335168460.358118, 10357856916.651573, 10379977532.283358, 10401553036.091604, 10422605151.86458, 10443154662.741882, 10463221467.711119] [-0.0, 248161723.11822093, 480772238.417906, 701809337.4067808, 914239246.2736205, 1120273707.7915533, 1321561690.5955443, 1519332362.2069383, 1714501723.573663, 1907752146.1550138, 2099591700.7561615, 2290398414.703836, 2480453287.6116886, 2669964922.119674, 2859087899.8934503, 3047936491.745762, 3236594886.9880214, 3425124826.0091, 3613571295.5022864, 3801966778.2579684, 3990334424.4987807, 4178690418.536488, 4367045745.008031, 4555407507.085466, 4743779910.363979, 4932164997.2673025, 5120563195.274701, 5308973726.206316, 5497394911.815594, 5685824401.992684, 5874259345.208261, 6066327896.74429, 6258395928.771198, 6448450296.681919, 6634987570.492452, 6816907023.232652, 6993425132.713683, 7164007321.335342, 7328313505.528417, 7486154705.735068, 7637458512.680345, 7782241642.6857605, 7920588165.262831, 8052632267.319782, 8178544643.750435, 8298521784.965411, 8412777576.907959, 8521536745.356818, 8625029769.541862, 8723488964.844193, 8817145494.279133, 8906227116.501314, 8990956516.579674, 9071550096.65372, 9148217128.315165, 9221159188.375206, 9290569815.551516, 9356634338.321241, 9419529834.364397, 9479425190.167406, 9536481235.873318, 9594969933.706583, 9650917096.215631, 9704417324.396915, 9755571488.969898, 9804484017.986137, 9851260796.646261, 9896007556.570953, 9938828655.572569, 9979826168.208467, 10019099222.937788, 10056743534.25753, 10092851088.332245, 10127509948.817125, 10160804156.1804, 10192813699.16053, 10223614541.291246, 10253278688.890966, 10281874289.702593, 10309465753.614704, 10336113888.70032, 10361876047.259315, 10386806277.71401, 10410955479.139254, 10434371555.953747, 10457099570.894215, 10479181894.867722, 10500658352.65348, 10521566363.723162, 10541941077.682993, 10561815504.024963] [-0.0, 244048989.58971217, 472678582.1668743, 692570782.6517417, 908532839.7312362, 1124049222.3905602, 1341671792.1726031, 1563295693.2636015, 1790354493.0072162, 2023958249.0758874, 2264991227.93608, 2516357129.9640617, 2780204357.111088, 3057294087.8859086, 3348318628.784593, 3653926069.935354, 3974737785.570483, 4311360870.128562, 4664396987.398571, 5034448676.53948, 5422123852.291843, 5828039019.974785, 6252821572.601894, 6697111429.047127, 7161562195.498266, 7646841978.158615, 8153633936.729183, 8682636640.98202, 9234564273.438887, 9810146707.479229, 10410129480.477844, 11042492852.739807, 11700794069.581718, 12370334288.70492, 13039865655.318098, 13700878033.197762, 14347028511.265522, 14973685359.01214, 15577563709.782686, 16156434748.193121, 16708893785.852985, 17234175503.92391, 17732006962.913677, 18202490842.67871, 18646012869.69851, 19063168587.157963, 19454705584.685284, 19821478075.646282, 20164411328.31692, 20484473953.233536, 20782656446.77259, 21059954709.968597, 21317357517.3277, 21559640414.235477, 21789281248.900406, 22006908944.03901, 22213132085.065243, 22408537160.646706, 22593687471.96686, 22769122560.738293, 22935358036.63029, 23092942244.693092, 23242283900.197998, 23383712638.647358, 23517571609.936554, 23644210178.35129, 23763978311.87949, 23877222318.999744, 23984281657.78448, 24085486595.972023, 24181156544.08929, 24271598918.742737, 24357108421.45352, 24437966641.19763, 24514441907.175568, 24586789333.1314, 24655251006.454575, 24720056284.88486, 24781422171.351482, 24839553743.67254, 24894644620.81452, 24946877451.399647, 24996424413.342453, 25043447716.05046, 25088100098.661358, 25130525319.411835, 25170858632.52152, 25209227249.995777, 25245750786.555008, 25280541686.529568, 25313705632.051914] [-0.0, 261490057.39137682, 507560545.7387295, 739191659.9876914, 957300915.2672126, 1162747225.1554523, 1356334701.400446, 1538816196.5594199, 1710896608.937019, 1873235967.3884962, 2026452311.965844, 2171124384.987595, 2307794145.8772917, 2436969122.017378, 2559124606.884575, 2674705715.853014, 2784129309.2589345, 2887785791.603898, 2986040795.122768, 3079236755.3499107, 3167694385.7754803, 3251714058.1872463, 3331577094.8375254, 3407546978.154835, 3479870483.3325047, 3548778738.768325, 3614488218.9977183, 3677201674.4554224, 3737109002.1151834, 3794388060.791652, 3849205434.641727, 3901717148.1727595, 3952069335.850742, 4000398869.2018466, 4046833944.114259, 4091494630.8732285, 4134493389.299731, 4175935551.2113085, 4215919772.281709, 4254538455.2433004, 4291878146.252158, 4328019906.119681, 4363039658.006071, 4397008513.069388, 4429993075.468927, 4462055728.032655, 4493254899.815209, 4523645316.695067, 4553278236.086458, 4582201666.773417, 4610460574.809267, 4638097076.365099, 4665150618.354679, 4691658147.610695, 4717654269.338154, 4743171395.524676, 4768239883.944302, 4792888168.351114, 4817142880.421083, 4841028963.965231, 4864569781.903945, 4887787216.461335, 4910701763.009283, 4933332617.963768, 4955697761.110387, 4977814032.712184, 4999697205.730477, 5021362053.4684305, 5042822412.927469, 5064091244.148274, 5085180685.790829, 5106102107.191906, 5126866157.123237, 5147482809.459472, 5167961405.951798, 5188310696.290639, 5208538875.629253, 5228653619.729166, 5248662117.878152, 5268571103.721938, 5288386884.141854, 5308115366.302273, 5327762082.983849, 5347332216.311175, 5366830619.976638, 5386261840.055762, 5405630134.503329, 5424939491.413869, 5444193646.124842, 5463396097.235841, 5482550121.612559]
df = pd.DataFrame(res, columns = ['Policy combination', 'Cases', 'Deaths', 'Loss'])
df = df.set_index('Policy combination')
df.sort_values(by='Loss')
Cases | Deaths | Loss | |
---|---|---|---|
Policy combination | |||
MT | T | T | 10734 | 577 | 4.525967 |
T | T | T | 11003 | 591 | 4.569165 |
L | L | L | 11003 | 591 | 4.932606 |
MDLT | MDLT | MDLT | 10006 | 539 | 5.482550 |
D | D | D | 22478 | 1138 | 8.436941 |
mt | Lt | Dl | 26023 | 1378 | 10.463221 |
mt | Lt | Dlt | 25736 | 1370 | 10.472406 |
mt | L | DlT | 25887 | 1383 | 10.561816 |
m | L | DT | 59338 | 3502 | 25.313706 |
M | M | M | 201929 | 8941 | 63.400395 |
- | m | - | 515900 | 23447 | 165.681432 |
- | - | d | 453512 | 23862 | 168.641122 |
- | - | M | 478792 | 24620 | 173.993851 |
- | - | m | 534917 | 26295 | 185.788009 |
- | - | - | 592136 | 28018 | 197.926939 |
- | - | - | 592136 | 28018 | 197.926939 |