diff options
-rw-r--r-- | out/COVID-19-ESIR-data.csv | 12 | ||||
-rw-r--r-- | out/COVID-19-Linear-data.csv | 10 | ||||
-rw-r--r-- | out/COVID-19-SEIR-data.csv | 14 | ||||
-rw-r--r-- | out/COVID-19-SIR-data.csv | 10 | ||||
-rw-r--r-- | out/SARS-ESIR-data.csv | 12 | ||||
-rw-r--r-- | out/SARS-Linear-data.csv | 10 | ||||
-rw-r--r-- | out/SARS-SEIR-data.csv | 14 | ||||
-rw-r--r-- | out/SARS-SIR-data.csv | 10 | ||||
-rw-r--r-- | solver2.py | 16 |
9 files changed, 54 insertions, 54 deletions
diff --git a/out/COVID-19-ESIR-data.csv b/out/COVID-19-ESIR-data.csv index b929084..fcd8049 100644 --- a/out/COVID-19-ESIR-data.csv +++ b/out/COVID-19-ESIR-data.csv @@ -1,6 +1,6 @@ -Beta: 0.11611254858884054 -Gamma: 0.004524040067261208 -Mu: 0.001 -R0: 21.019497899190398 -Predicted I: 1266.3066498710834 -Actual I: 1320.7366666666667
\ No newline at end of file +Beta, 0.11611254858884054 +Gamma, 0.004524040067261208 +Mu, 0.001 +R0, 21.019497899190398 +Predicted I, 1266.3066498710834 +Actual I, 1320.7366666666667
\ No newline at end of file diff --git a/out/COVID-19-Linear-data.csv b/out/COVID-19-Linear-data.csv index a4fada7..e4a8a16 100644 --- a/out/COVID-19-Linear-data.csv +++ b/out/COVID-19-Linear-data.csv @@ -1,5 +1,5 @@ -Beta: 0.001 -Gamma: 0.001264208619688091 -R0: 0.7910086867203316 -Predicted I: 697.635036958848 -Actual I: 1320.7366666666667
\ No newline at end of file +Beta, 0.001 +Gamma, 0.001264208619688091 +R0, 0.7910086867203316 +Predicted I, 697.635036958848 +Actual I, 1320.7366666666667
\ No newline at end of file diff --git a/out/COVID-19-SEIR-data.csv b/out/COVID-19-SEIR-data.csv index 81ae1a4..08a3360 100644 --- a/out/COVID-19-SEIR-data.csv +++ b/out/COVID-19-SEIR-data.csv @@ -1,7 +1,7 @@ -Beta: 0.11054352661813334 -Gamma: 0.001 -Mu: 0.0009999999999999992 -Sigma: 0.005265008086429555 -R0: 46.4494661074415 -Predicted I: 1267.3615656181303 -Actual I: 1320.7366666666667
\ No newline at end of file +Beta, 0.11054352661813334 +Gamma, 0.001 +Mu, 0.0009999999999999992 +Sigma, 0.005265008086429555 +R0, 46.4494661074415 +Predicted I, 1267.3615656181303 +Actual I, 1320.7366666666667
\ No newline at end of file diff --git a/out/COVID-19-SIR-data.csv b/out/COVID-19-SIR-data.csv index a3e4ce6..7c2b68d 100644 --- a/out/COVID-19-SIR-data.csv +++ b/out/COVID-19-SIR-data.csv @@ -1,5 +1,5 @@ -Beta: 0.11506078739615723 -Gamma: 0.004484934156558218 -R0: 25.654955765160217 -Predicted I: 1266.8203435457365 -Actual I: 1320.7366666666667
\ No newline at end of file +Beta, 0.11506078739615723 +Gamma, 0.004484934156558218 +R0, 25.654955765160217 +Predicted I, 1266.8203435457365 +Actual I, 1320.7366666666667
\ No newline at end of file diff --git a/out/SARS-ESIR-data.csv b/out/SARS-ESIR-data.csv index 7fa0191..0a83b31 100644 --- a/out/SARS-ESIR-data.csv +++ b/out/SARS-ESIR-data.csv @@ -1,6 +1,6 @@ -Beta: 0.2367380660038712 -Gamma: 0.08679089871294347 -Mu: 0.10967080829342284 -R0: 1.2050086992077278 -Predicted I: 934.6300578153925 -Actual I: 877.5
\ No newline at end of file +Beta, 0.2367380660038712 +Gamma, 0.08679089871294347 +Mu, 0.10967080829342284 +R0, 1.2050086992077278 +Predicted I, 934.6300578153925 +Actual I, 877.5
\ No newline at end of file diff --git a/out/SARS-Linear-data.csv b/out/SARS-Linear-data.csv index f41c322..d33e313 100644 --- a/out/SARS-Linear-data.csv +++ b/out/SARS-Linear-data.csv @@ -1,5 +1,5 @@ -Beta: 0.002255721398145891 -Gamma: 0.017414910100826592 -R0: 0.12952816782205634 -Predicted I: 946.1041288549815 -Actual I: 877.5
\ No newline at end of file +Beta, 0.002255721398145891 +Gamma, 0.017414910100826592 +R0, 0.12952816782205634 +Predicted I, 946.1041288549815 +Actual I, 877.5
\ No newline at end of file diff --git a/out/SARS-SEIR-data.csv b/out/SARS-SEIR-data.csv index 6170d61..71d0ad8 100644 --- a/out/SARS-SEIR-data.csv +++ b/out/SARS-SEIR-data.csv @@ -1,7 +1,7 @@ -Beta: 0.025728454417841363 -Gamma: 0.001 -Mu: 0.001 -Sigma: 0.5156784257190153 -R0: 12.83932927130887 -Predicted I: 1009.5304659757634 -Actual I: 877.5
\ No newline at end of file +Beta, 0.025728454417841363 +Gamma, 0.001 +Mu, 0.001 +Sigma, 0.5156784257190153 +R0, 12.83932927130887 +Predicted I, 1009.5304659757634 +Actual I, 877.5
\ No newline at end of file diff --git a/out/SARS-SIR-data.csv b/out/SARS-SIR-data.csv index de7798e..7abe8bb 100644 --- a/out/SARS-SIR-data.csv +++ b/out/SARS-SIR-data.csv @@ -1,5 +1,5 @@ -Beta: 0.031663066064741584 -Gamma: 0.018520041050816886 -R0: 1.7096650044058612 -Predicted I: 1006.3748700651734 -Actual I: 877.5
\ No newline at end of file +Beta, 0.031663066064741584 +Gamma, 0.018520041050816886 +R0, 1.7096650044058612 +Predicted I, 1006.3748700651734 +Actual I, 877.5
\ No newline at end of file @@ -147,8 +147,8 @@ class Learner(object): print(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}, Actual I: {extended_actual[-1] * correction_factor}') df = compose_df(prediction, extended_actual, correction_factor, new_index) with open(f'out/{args.disease}-{args.mode}-data.csv', 'w+') as file: - file.write(f'Beta: {beta}\nGamma: {gamma}\nR0: {beta/gamma}\n') - file.write(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}\nActual I: {extended_actual[-1] * correction_factor}') + file.write(f'Beta, {beta}\nGamma, {gamma}\nR0, {beta/gamma}\n') + file.write(f'Predicted I, {prediction.y[1][-1] * int(args.popmodel)}\nActual I, {extended_actual[-1] * correction_factor}') elif args.mode == 'SIR': optimal = minimize( loss_sir, @@ -163,8 +163,8 @@ class Learner(object): print(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}, Actual I: {extended_actual[-1] * correction_factor}') df = compose_df(prediction, extended_actual, correction_factor, new_index) with open(f'out/{args.disease}-{args.mode}-data.csv', 'w+') as file: - file.write(f'Beta: {beta}\nGamma: {gamma}\nR0: {beta/gamma}\n') - file.write(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}\nActual I: {extended_actual[-1] * correction_factor}') + file.write(f'Beta, {beta}\nGamma, {gamma}\nR0, {beta/gamma}\n') + file.write(f'Predicted I, {prediction.y[1][-1] * int(args.popmodel)}\nActual I, {extended_actual[-1] * correction_factor}') elif args.mode == 'ESIR': optimal = minimize( loss_esir, @@ -179,8 +179,8 @@ class Learner(object): print(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}, Actual I: {extended_actual[-1] * correction_factor}') df = compose_df(prediction, extended_actual, correction_factor, new_index) with open(f'out/{args.disease}-{args.mode}-data.csv', 'w+') as file: - file.write(f'Beta: {beta}\nGamma: {gamma}\nMu: {mu}\nR0: {beta/(gamma + mu)}\n') - file.write(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}\nActual I: {extended_actual[-1] * correction_factor}') + file.write(f'Beta, {beta}\nGamma, {gamma}\nMu, {mu}\nR0, {beta/(gamma + mu)}\n') + file.write(f'Predicted I, {prediction.y[1][-1] * int(args.popmodel)}\nActual I, {extended_actual[-1] * correction_factor}') elif args.mode == 'SEIR': # exposed_data = self.load_exposed(self.country) @@ -197,8 +197,8 @@ class Learner(object): print(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}, Actual I: {extended_actual[-1] * correction_factor}') df = compose_df(prediction, extended_actual, correction_factor, new_index) with open(f'out/{args.disease}-{args.mode}-data.csv', 'w+') as file: - file.write(f'Beta: {beta}\nGamma: {gamma}\nMu: {mu}\nSigma: {sigma}\nR0: {(beta * sigma)/((mu + gamma) * (mu + sigma))}\n') - file.write(f'Predicted I: {prediction.y[1][-1] * int(args.popmodel)}\nActual I: {extended_actual[-1] * correction_factor}') + file.write(f'Beta, {beta}\nGamma, {gamma}\nMu, {mu}\nSigma, {sigma}\nR0, {(beta * sigma)/((mu + gamma) * (mu + sigma))}\n') + file.write(f'Predicted I, {prediction.y[1][-1] * int(args.popmodel)}\nActual I, {extended_actual[-1] * correction_factor}') fig, ax = plt.subplots(figsize=(15, 10)) ax.set_title(f'{args.disease} cases over time ({args.mode} Model)') df.plot(ax=ax) |