aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SARS.pngbin28850 -> 28280 bytes
-rw-r--r--data/SARS-Confirmed2.csv2
-rw-r--r--data/sars-confirmed.csv4
-rw-r--r--out/SARS-data.csv4
-rw-r--r--out/SARS-prediction.csv85
-rw-r--r--solver2.py2
6 files changed, 83 insertions, 14 deletions
diff --git a/SARS.png b/SARS.png
index c166acf..53eb45c 100644
--- a/SARS.png
+++ b/SARS.png
Binary files differ
diff --git a/data/SARS-Confirmed2.csv b/data/SARS-Confirmed2.csv
new file mode 100644
index 0000000..9bf50bb
--- /dev/null
+++ b/data/SARS-Confirmed2.csv
@@ -0,0 +1,2 @@
+Country/Region,3/17/03,3/18/03,3/19/03,3/20/03,3/21/03,3/22/03,3/24/03,3/25/03,3/26/03,3/27/03,3/28/03,3/29/03,3/31/03,4/1/03,4/2/03,4/3/03,4/4/03,4/5/03,4/7/03,4/8/03,4/9/03,4/10/03,4/11/03,4/12/03,4/14/03,4/15/03,4/16/03,4/17/03,4/18/03,4/19/03,4/21/03,4/22/03,4/23/03,4/24/03,4/25/03,4/26/03,4/28/03,4/29/03,4/30/03,5/1/03,5/2/03,5/3/03,5/5/03,5/6/03,5/7/03,5/8/03,5/9/03,5/10/03,5/12/03,5/13/03,5/14/03,5/15/03,5/16/03,5/17/03,5/19/03,5/20/03,5/21/03,5/22/03,5/23/03,5/24/03,5/26/03,5/27/03,5/28/03,5/29/03,5/30/03,5/31/03,6/2/03,6/3/03,6/4/03,6/5/03,6/6/03,6/9/03,6/10/03,6/11/03,6/12/03,6/13/03,6/16/03,6/17/03,6/18/03,6/19/03,6/20/03,6/23/03,6/24/03,6/25/03,6/26/03,6/27/03,6/30/03,7/1/03,7/2/03,7/3/03,7/4/03,7/7/03,7/8/03,7/9/03,7/10/03,7/11/03,8/7/03
+Hong_Kong,95,123,150,173,203,222,260,286,316,367,425,470,530,685,708,734,761,800,883,928,970,998,1059,1108,1190,1232,1268,1297,1358,1358,1402,1434,1458,1488,1510,1527,1557,1572,1589,1600,1611,1621,1637,1646,1654,1661,1667,1674,1683,1689,1698,1703,1706,1710,1714,1718,1719,1722,1724,1724,1726,1728,1730,1732,1736,1739,1746,1747,1748,1748,1750,1753,1754,1754,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755
diff --git a/data/sars-confirmed.csv b/data/sars-confirmed.csv
index 9bf50bb..4eeaf13 100644
--- a/data/sars-confirmed.csv
+++ b/data/sars-confirmed.csv
@@ -1,2 +1,2 @@
-Country/Region,3/17/03,3/18/03,3/19/03,3/20/03,3/21/03,3/22/03,3/24/03,3/25/03,3/26/03,3/27/03,3/28/03,3/29/03,3/31/03,4/1/03,4/2/03,4/3/03,4/4/03,4/5/03,4/7/03,4/8/03,4/9/03,4/10/03,4/11/03,4/12/03,4/14/03,4/15/03,4/16/03,4/17/03,4/18/03,4/19/03,4/21/03,4/22/03,4/23/03,4/24/03,4/25/03,4/26/03,4/28/03,4/29/03,4/30/03,5/1/03,5/2/03,5/3/03,5/5/03,5/6/03,5/7/03,5/8/03,5/9/03,5/10/03,5/12/03,5/13/03,5/14/03,5/15/03,5/16/03,5/17/03,5/19/03,5/20/03,5/21/03,5/22/03,5/23/03,5/24/03,5/26/03,5/27/03,5/28/03,5/29/03,5/30/03,5/31/03,6/2/03,6/3/03,6/4/03,6/5/03,6/6/03,6/9/03,6/10/03,6/11/03,6/12/03,6/13/03,6/16/03,6/17/03,6/18/03,6/19/03,6/20/03,6/23/03,6/24/03,6/25/03,6/26/03,6/27/03,6/30/03,7/1/03,7/2/03,7/3/03,7/4/03,7/7/03,7/8/03,7/9/03,7/10/03,7/11/03,8/7/03
-Hong_Kong,95,123,150,173,203,222,260,286,316,367,425,470,530,685,708,734,761,800,883,928,970,998,1059,1108,1190,1232,1268,1297,1358,1358,1402,1434,1458,1488,1510,1527,1557,1572,1589,1600,1611,1621,1637,1646,1654,1661,1667,1674,1683,1689,1698,1703,1706,1710,1714,1718,1719,1722,1724,1724,1726,1728,1730,1732,1736,1739,1746,1747,1748,1748,1750,1753,1754,1754,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755
+Country/Region,4/10/03,4/11/03,4/12/03,4/14/03,4/15/03,4/16/03,4/17/03,4/18/03,4/19/03,4/21/03,4/22/03,4/23/03,4/24/03,4/25/03,4/26/03,4/28/03,4/29/03,4/30/03,5/1/03,5/2/03,5/3/03,5/5/03,5/6/03,5/7/03,5/8/03,5/9/03,5/10/03,5/12/03,5/13/03,5/14/03,5/15/03,5/16/03,5/17/03,5/19/03,5/20/03,5/21/03,5/22/03,5/23/03,5/24/03,5/26/03,5/27/03,5/28/03,5/29/03,5/30/03,5/31/03,6/2/03,6/3/03,6/4/03,6/5/03,6/6/03,6/9/03,6/10/03,6/11/03,6/12/03,6/13/03,6/16/03,6/17/03,6/18/03,6/19/03,6/20/03,6/23/03,6/24/03,6/25/03,6/26/03,6/27/03,6/30/03,7/1/03,7/2/03,7/3/03,7/4/03,7/7/03,7/8/03,7/9/03,7/10/03,7/11/03,8/7/03
+Hong_Kong,998,1059,1108,1190,1232,1268,1297,1358,1358,1402,1434,1458,1488,1510,1527,1557,1572,1589,1600,1611,1621,1637,1646,1654,1661,1667,1674,1683,1689,1698,1703,1706,1710,1714,1718,1719,1722,1724,1724,1726,1728,1730,1732,1736,1739,1746,1747,1748,1748,1750,1753,1754,1754,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755,1755
diff --git a/out/SARS-data.csv b/out/SARS-data.csv
index f98e7f5..65b5f2f 100644
--- a/out/SARS-data.csv
+++ b/out/SARS-data.csv
@@ -1,3 +1,3 @@
Beta: 1e-08
-Gamma: 0.01700912239686379
-R0: 5.879198095396057e-07 \ No newline at end of file
+Gamma: 0.0061248427719888315
+R0: 1.6326949723074842e-06 \ No newline at end of file
diff --git a/out/SARS-prediction.csv b/out/SARS-prediction.csv
index 2849d47..f677152 100644
--- a/out/SARS-prediction.csv
+++ b/out/SARS-prediction.csv
@@ -1,10 +1,77 @@
,Actual,S,I,R
-4/10/03,0.21148953068592058,13499.000074068588,0.9999259314124879,0.0
-4/11/03,0.2244162454873646,13499.000074058673,0.98306190629524,0.016864035031213732
-4/12/03,0.23479999999999998,13499.000074048927,0.9664822974727793,0.033443653600438765
-4/14/03,0.2521768953068592,13499.000074039344,0.9501823087970815,0.049743651858518506
-4/15/03,0.2610772563176895,13499.000074029924,0.9341572239618826,0.06576874611448988
-4/16/03,0.2687061371841155,13499.000074020661,0.9184024060302004,0.08152357330806109
-4/17/03,0.27485162454873646,13499.000074011556,0.9029132970915866,0.09701269135235983
-4/18/03,0.2877783393501805,13499.000074002603,0.8876854169726223,0.11224058042343865
-4/19/03,0.2877783393501805,13499.000073993802,0.872714359634142,0.12721164656305334
+4/10/03,0.1566473081148956,9999.0,1.0,0.0
+4/11/03,0.16622194318003453,9998.999999990032,0.9938938857782499,0.00610612419019138
+4/12/03,0.17391304347826086,9998.999999980124,0.9878250561849686,0.01217496369104556
+4/14/03,0.18678386438549677,9998.999999970278,0.9817932835629529,0.018206746160137382
+4/15/03,0.1933762360696908,9998.99999996049,0.9757983416361868,0.02420169787385227
+4/16/03,0.1990268403704285,9998.999999950764,0.9698400055077305,0.03016004372949699
+4/17/03,0.20357871605713387,9998.999999941096,0.9639180446502709,0.036082014254761215
+4/18/03,0.2131533511222728,9998.999999931486,0.958032229361117,0.0419678391527109
+4/19/03,0.2131533511222728,9998.999999921936,0.9521823415639332,0.04781773650003748
+4/21/03,0.2200596452676189,9998.999999912445,0.9463681643524197,0.05363192320339512
+4/22/03,0.22508240464605242,9998.99999990301,0.9405894819398969,0.05941061504981562
+4/23/03,0.22884947417987755,9998.999999893635,0.9348460796593057,0.0651540267067084
+4/24/03,0.233558311097159,9998.999999884314,0.9291377439632077,0.07086237172186058
+4/25/03,0.23701145816983205,9998.999999875054,0.9234642624237851,0.07653586252343685
+4/26/03,0.23967979908962483,9998.999999865848,0.9178254237328403,0.08217471041997958
+4/28/03,0.24438863600690627,9998.999999856698,0.9122210177017966,0.08777912560040879
+4/29/03,0.246743054465547,9998.999999847605,0.9066508352616974,0.09334931713402214
+4/30/03,0.2494113953853398,9998.999999838567,0.9011146684632072,0.09888549297049494
+5/1/03,0.25113796892167634,9998.999999829583,0.8956123104766106,0.10438785993988008
+5/2/03,0.2528645424580129,9998.999999820655,0.8901435555918127,0.10985662375260818
+5/3/03,0.25443415476377335,9998.999999811782,0.8847081992183395,0.11529198899948748
+5/5/03,0.2569455344529901,9998.999999802963,0.8793060378853373,0.1206941591517038
+5/6/03,0.2583581855281745,9998.999999794198,0.8739368692415727,0.1260633365608207
+5/7/03,0.2596138753727829,9998.999999785487,0.8686004920554333,0.1313997224587793
+5/8/03,0.26071260398681523,9998.999999776828,0.8632967062149268,0.1367035169578984
+5/9/03,0.26165437137027153,9998.99999976822,0.8580253127276819,0.14197491905087448
+5/10/03,0.26275309998430385,9998.999999759668,0.8527861137209471,0.14721412661078156
+5/12/03,0.2641657510594883,9998.999999751168,0.8475789124415923,0.1524213363910714
+5/13/03,0.26510751844294456,9998.999999742719,0.8424035132561074,0.1575967440255734
+5/14/03,0.266520169518129,9998.999999734322,0.8372597216506029,0.16274054402849447
+5/15/03,0.26730497567100925,9998.999999725975,0.8321473442308099,0.1678529297944193
+5/16/03,0.2677758593627374,9998.99999971768,0.8270661887220798,0.17293409359831027
+5/17/03,0.26840370428504157,9998.999999709435,0.8220160639693852,0.17798422659550728
+5/19/03,0.2690315492073458,9998.999999701242,0.8169967799373182,0.18300351882172788
+5/20/03,0.26965939412964995,9998.999999693096,0.8120081477100923,0.18799215919306728
+5/21/03,0.269816355360226,9998.999999685002,0.8070499794915413,0.1929503355059984
+5/22/03,0.2702872390519542,9998.999999676957,0.8021220886051191,0.1978782344373717
+5/23/03,0.27060116151310626,9998.999999668962,0.7972242894939008,0.20277604154441542
+5/24/03,0.27060116151310626,9998.999999661015,0.7923563977205816,0.20764394126473523
+5/26/03,0.27091508397425834,9998.999999653117,0.7875182299674773,0.21248211691631466
+5/27/03,0.2712290064354104,9998.999999645266,0.7827096040365243,0.21729075069751472
+5/28/03,0.2715429288965625,9998.999999637463,0.7779303388492795,0.22207002368707426
+5/29/03,0.27185685135771465,9998.999999629708,0.7731802544469202,0.22682011584410958
+5/30/03,0.2724846962800188,9998.999999622001,0.7684591719902444,0.23154120600811465
+5/31/03,0.27295557997174696,9998.999999614342,0.7637669137596708,0.23623347189896113
+6/2/03,0.2740543085857793,9998.999999606727,0.7591033031552382,0.24089709011689836
+6/3/03,0.27421126981635535,9998.99999959916,0.754468164696606,0.24553223614255326
+6/4/03,0.27436823104693137,9998.99999959164,0.7498613240230546,0.2501390843369304
+6/5/03,0.27436823104693137,9998.999999584164,0.7452826078934843,0.2547178079414121
+6/6/03,0.2746821535080835,9998.999999576736,0.7407318441864165,0.25926857907775797
+6/9/03,0.27515303719981166,9998.999999569352,0.7362088618999928,0.2637915687481058
+6/10/03,0.27530999843038767,9998.999999562013,0.7317134911519751,0.26828694683497056
+6/11/03,0.27530999843038767,9998.999999554719,0.7272455646461425,0.27275488063484693
+6/12/03,0.27546695966096374,9998.99999954747,0.7228049183018899,0.27719553422860754
+6/13/03,0.27546695966096374,9998.999999540265,0.7183913861666602,0.28160907356908
+6/16/03,0.27546695966096374,9998.999999533102,0.7140048031056461,0.2859956637913417
+6/17/03,0.27546695966096374,9998.999999525984,0.7096450049155073,0.2903554690990009
+6/18/03,0.27546695966096374,9998.999999518912,0.7053118283243721,0.2946886527641958
+6/19/03,0.27546695966096374,9998.999999511881,0.7010051109918364,0.2989953771275956
+6/20/03,0.27546695966096374,9998.999999504893,0.6967246915089644,0.30327580359839945
+6/23/03,0.27546695966096374,9998.999999497948,0.6924704093982882,0.3075300926543374
+6/24/03,0.27546695966096374,9998.999999491043,0.6882421051138082,0.3117584038416696
+6/25/03,0.27546695966096374,9998.999999484184,0.6840396200409922,0.3159608957751869
+6/26/03,0.27546695966096374,9998.999999477364,0.6798627964967765,0.32013772613821057
+6/27/03,0.27546695966096374,9998.999999470589,0.6757114777295653,0.32428905168259226
+6/30/03,0.27546695966096374,9998.999999463853,0.671585507919231,0.32841502822871405
+7/1/03,0.27546695966096374,9998.999999457157,0.6674847321771137,0.3325158106654888
+7/2/03,0.27546695966096374,9998.999999450503,0.6634089965460216,0.3365915529503593
+7/3/03,0.27546695966096374,9998.999999443891,0.6593581480002312,0.34064240810929924
+7/4/03,0.27546695966096374,9998.999999437317,0.6553320344454865,0.34466852823681265
+7/7/03,0.27546695966096374,9998.999999430785,0.651330504719,0.3486700644959339
+7/8/03,0.27546695966096374,9998.999999424292,0.647353408589452,0.35264716711822797
+7/9/03,0.27546695966096374,9998.99999941784,0.643400596756991,0.35659998540379023
+7/10/03,0.27546695966096374,9998.999999411426,0.6394719208532331,0.36052866772124653
+7/11/03,0.27546695966096374,9998.99999940505,0.635567233441263,0.3644333615077531
+8/7/03,0.27546695966096374,9998.999999398715,0.6316863880156327,0.36831421326899677
diff --git a/solver2.py b/solver2.py
index ae2403a..906673c 100644
--- a/solver2.py
+++ b/solver2.py
@@ -45,7 +45,7 @@ class Learner(object):
if args.end != None:
confirmed_sums = np.sum([reg.loc[args.start:args.end].values for reg in country_df.iloc], axis = 0)
else:
- confirmed_sums = np.sum([reg.loc[[args.start:]].values for reg in country_df.iloc], axis = 0)
+ confirmed_sums = np.sum([reg.loc[args.start:].values for reg in country_df.iloc], axis = 0)
if args.end != None:
new_data = pd.DataFrame(confirmed_sums, country_df.iloc[0].loc[args.start:args.end].index.tolist())