File:Kevaan 2020 koronavirus aalto Suomessa - simulaatio - paivittaiset tapaukset - 1.svg
Original file (SVG file, nominally 804 × 462 pixels, file size: 46 KB)
Captions
Summary
[edit]DescriptionKevaan 2020 koronavirus aalto Suomessa - simulaatio - paivittaiset tapaukset - 1.svg |
Suomi: Oletettuihin R0-arvoihin perustuva simulaatio kevään koronavirusaallosta.
Yksinkertainen simulaatio laskee R0 arvon ja aallon nousuajan pohjalta päivittäiset tapausmäärät. R0 on nousajan R0, Rt laskuajan R0.
English: Simple R0- and rising time of Covid wave based simulation of covid-19 Vawe in finland.
R0, Rt ajd rising time numbers are "ad hoc" like assumptions only. |
Date | |
Source | Own work |
Author | Merikanto |
Python code to produce simulated covod-19
epidemy curves, based on very coarse assumptions of R0 and
time to reach peak of epidemy.
-
- covid 19 finland epidemy R0 and time to peak simu test
- alpha draft edition r 0001
-
import math as math
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
- very basic exponential r0 calculation
def calculate_r0(time1, time2, val1, val2):
k=0
td=time2-time1
gr0=math.log(val2/val1)
gr=gr0/td
if(gr!=0):
td= math.log(2.0)/gr
else:
return(1)
tau=5.0
k=math.log(2.0)/td
r0=math.exp(k*tau)
if(r0==32):
r0=1
if(r0>32):
r0=4
return(r0)
- exp(gr0)=val2/val1
dfin = pd.read_csv('kases1.csv', sep=';')
tapaukset00=dfin["Confirmed"]
tapaukset=np.array(tapaukset00)
len1=len(tapaukset)
dailycases00= [0] * len1
for n in range(1,(len1-1)):
dailycases00[n]=tapaukset[n]-tapaukset[n-1]
if (dailycases00[n]<0): dailycases00[n]=0
paivittaiset_tapaukset=np.array(dailycases00)
print (tapaukset)
- quit(0)
maara=160
tap=tapaukset[0:maara]
ptap=paivittaiset_tapaukset[0:maara]
- quit(0)
x=np.linspace(0,maara,maara)
y=np.linspace(0,maara,maara)
dy=np.linspace(0,maara,maara)
cy=np.linspace(0,maara,maara)
ppy=np.linspace(0,maara,maara)
pky=np.linspace(0,maara,maara)
psy=np.linspace(0,maara,maara)
pty=np.linspace(0,maara,maara)
py=np.linspace(0,maara,maara)
ky=np.linspace(0,maara,maara)
sy=np.linspace(0,maara,maara)
ty=np.linspace(0,maara,maara)
ssy=np.linspace(0,maara,maara)
tty=np.linspace(0,maara,maara)
for n in range(0, maara):
ssy[n]=0
sy[n]=0
psy[n]=0
ky[n]=0
pky[n]=0
tty[n]=0
ty[n]=0
pty[n]=0
- tapauksia=1
- huippuaika=40
- ro=2.0
- laskuro=0.8
tapauksia=1
huippuaika=40
ro=2.0
laskuro=0.8
tau=5.0
for n in range(0, maara):
dndt=tapauksia*(math.log(ro)/tau)
tapauksia=tapauksia+dndt
#print(n,int(tapauksia), int(dndt), ro)
if(n>huippuaika): ro=laskuro
dy[n]=dndt
y[n]=tapauksia
cy[n]=tapauksia
if (n>9): cy[n]=cy[n-1]+tapauksia
pky[n]=0
ky[n]=0
# kuolemat, 14 pv kuluttua
if (n>21):
pky[n]=y[n-21]*0.045
ky[n]=ky[n-1]+pky[n]
# parantuneet tai pitkäaikainen korona, 14 pv kuluttua
if (n>14):
ppy[n]=y[n-14]*(1-0.045)
py[n]=py[n-1]+ppy[n]
# sairaalaan
if (n>5):
ssisaan=y[n-5]*0.06
psy[n]=ssisaan ## sinä päivänä sairaalaan joutuneet
sy[n]=sy[n-1]+ssisaan ## koko jakson aikanaa sairaalaan joutuneet
ssy[n]=ssy[n-1]+ssisaan ## sairaalassa
# sairaalasta
if (n>35):
sulos=psy[n-35]
#kuolleet=y[n-14]*(1-0.045)
ssy[n]=ssy[n]-sulos ## sairaalassa
if (ssy[n]<0): ssy[n]=0
# teholle
if (n>7):
tsisaan=y[n-7]*0.019
pty[n]=tsisaan ## sinä päivänä teholle joutuneet
ty[n]=ty[n-1]+tsisaan ## koko jakson aikana tehollejoutuneet
tty[n]=tty[n-1]+tsisaan ## teholla
# teholta
if (n>35):
tulos=pty[n-35]
#kuolleet=y[n-14]*(1-0.045)
tty[n]=tty[n]-tulos ## teholle
if (tty[n]<0): tty[n]=0
laapeli1="Simulaatio, oletukset: \n Nousuaika "+str(huippuaika)+" päivää \n Alussa R0="+str("2.0")+ "\n Huipun jälkeen Rt="+str(laskuro)
- plt.plot(x,dy)
- plt.plot(x,y)
plt.title("Kevään 2020 koronavirusaallon simulaatio", fontsize=20)
plt.xlabel("Päivää 1. tapauksesta", fontsize=16)
plt.ylabel("Lukumäärä", fontsize=16)
plt.xticks(fontsize=15 )
plt.yticks(fontsize=15 )
- plt.plot(x,cy, 'g--',label=laapeli1)
- plt.plot(x,tap, 'r', label="Kaikki tapaukset")
plt.plot(x,ptap, 'r', label="Päivittäiset tapaukset")
plt.plot(x,y, 'g',linewidth=4, label=laapeli1)
- plt.plot(x,pky, 'r', label="Päivittäiset kuolemat")
- plt.plot(x,ky, 'r', label="Kuolemat")
- plt.plot(x,ppy, 'r', label="Ei-kuolleet")
- plt.plot(x,py, 'r', label="Ei-kuolleet: panatunut tai pitkäaikaine korona")
- plt.plot(x,ssy, 'r', label="Sairaalassa olijat")
- plt.plot(x,psy, 'r', label="Sairaalaan tulijat")
- plt.plot(x,sy, 'r', label="Sairaalaan joutuneet")
- plt.plot(x,tty, 'r', label="Teholla olijat")
- plt.plot(x,pty, 'r', label="Teholle tulijat")
- plt.plot(x,ty, 'r', label="Teholle joutuneet")
- plt.plot(x,ptap, '#7f0000', linewidth=1.5, label="Päivittäiset tapaukset")
- plt.plot(x,y, 'g',linewidth=4, label=laapeli1)
plt.legend(fontsize=14)
plt.show()
Data
IDX;Date;Confirmed;Recovered;Deaths
6641;2020-02-26;2;1;0
6829;2020-02-27;2;1;0
7017;2020-02-28;2;1;0
7205;2020-02-29;3;1;0
7393;2020-03-01;6;1;0
7581;2020-03-02;6;1;0
7769;2020-03-03;6;1;0
7957;2020-03-04;6;1;0
8145;2020-03-05;12;1;0
8333;2020-03-06;15;1;0
8521;2020-03-07;15;1;0
8709;2020-03-08;23;1;0
8897;2020-03-09;30;1;0
9085;2020-03-10;40;1;0
9273;2020-03-11;59;1;0
9461;2020-03-12;59;1;0
9649;2020-03-13;155;1;0
9837;2020-03-14;225;1;0
10025;2020-03-15;244;10;0
10213;2020-03-16;277;10;0
10401;2020-03-17;321;10;0
10589;2020-03-18;336;10;0
10777;2020-03-19;400;10;0
10965;2020-03-20;450;10;0
11153;2020-03-21;523;10;1
11341;2020-03-22;626;10;1
11529;2020-03-23;700;10;1
11717;2020-03-24;792;10;1
11905;2020-03-25;880;10;3
12093;2020-03-26;958;10;5
12281;2020-03-27;1041;10;7
12469;2020-03-28;1167;10;9
12657;2020-03-29;1240;10;11
12845;2020-03-30;1352;10;13
13033;2020-03-31;1418;10;17
13221;2020-04-01;1446;10;17
13409;2020-04-02;1518;300;19
13597;2020-04-03;1615;300;20
13785;2020-04-04;1882;300;25
13973;2020-04-05;1927;300;28
14161;2020-04-06;2176;300;27
14349;2020-04-07;2308;300;34
14537;2020-04-08;2487;300;40
14725;2020-04-09;2605;300;42
14913;2020-04-10;2769;300;48
15101;2020-04-11;2905;300;49
15289;2020-04-12;2974;300;56
15477;2020-04-13;3064;300;59
15665;2020-04-14;3161;300;64
15853;2020-04-15;3237;300;72
16041;2020-04-16;3369;1700;75
16229;2020-04-17;3489;1700;82
16417;2020-04-18;3681;1700;90
16605;2020-04-19;3783;1700;94
16793;2020-04-20;3868;2000;98
16981;2020-04-21;4014;2000;141
17169;2020-04-22;4129;2000;149
17357;2020-04-23;4284;2000;172
17545;2020-04-24;4395;2500;177
17733;2020-04-25;4475;2500;186
17921;2020-04-26;4576;2500;190
18109;2020-04-27;4695;2500;193
18297;2020-04-28;4740;2800;199
18485;2020-04-29;4906;2800;206
18673;2020-04-30;4995;3000;211
18861;2020-05-01;5051;3000;218
19049;2020-05-02;5176;3000;220
19237;2020-05-03;5254;3000;230
19425;2020-05-04;5327;3500;240
19613;2020-05-05;5412;3500;246
19801;2020-05-06;5573;3500;252
19989;2020-05-07;5673;3500;255
20177;2020-05-08;5738;4000;260
20365;2020-05-09;5880;4000;265
20553;2020-05-10;5962;4000;267
20741;2020-05-11;5984;4000;271
20929;2020-05-12;6003;4300;275
21117;2020-05-13;6054;4300;284
21305;2020-05-14;6145;4300;287
21493;2020-05-15;6228;5000;293
21681;2020-05-16;6286;5000;297
21869;2020-05-17;6347;5000;298
22057;2020-05-18;6380;5000;300
22245;2020-05-19;6399;5000;301
22433;2020-05-20;6443;4800;304
22621;2020-05-21;6493;4800;306
22809;2020-05-22;6537;4800;306
22997;2020-05-23;6568;4800;306
23185;2020-05-24;6579;4800;307
23373;2020-05-25;6599;5100;308
23561;2020-05-26;6628;5100;312
23749;2020-05-27;6692;5100;313
23937;2020-05-28;6743;5500;313
24125;2020-05-29;6776;5500;314
24313;2020-05-30;6826;5500;316
24501;2020-05-31;6859;5500;320
24689;2020-06-01;6885;5500;318
24877;2020-06-02;6887;5500;320
25065;2020-06-03;6911;5500;321
25253;2020-06-04;6911;5800;322
25441;2020-06-05;6941;5800;322
25629;2020-06-06;6964;5800;322
25817;2020-06-07;6981;5800;323
26005;2020-06-08;7001;5800;323
26193;2020-06-09;7025;5800;324
26381;2020-06-10;7040;5800;324
26569;2020-06-11;7064;6200;325
26757;2020-06-12;7073;6200;325
26945;2020-06-13;7087;6200;325
27133;2020-06-14;7104;6200;326
27321;2020-06-15;7108;6200;326
27509;2020-06-16;7112;6200;326
27697;2020-06-17;7117;6200;326
27885;2020-06-18;7119;6200;326
28073;2020-06-19;7133;6200;326
28261;2020-06-20;7142;6200;326
28449;2020-06-21;7143;6200;326
28637;2020-06-22;7144;6400;327
28825;2020-06-23;7155;6400;327
29013;2020-06-24;7167;6600;327
29201;2020-06-25;7172;6600;327
29389;2020-06-26;7191;6600;328
29577;2020-06-27;7198;6600;328
29765;2020-06-28;7198;6600;328
29953;2020-06-29;7209;6600;328
30141;2020-06-30;7214;6600;328
30329;2020-07-01;7236;6700;328
30517;2020-07-02;7241;6700;328
30705;2020-07-03;7242;6700;329
30893;2020-07-04;7248;6700;329
31081;2020-07-05;7253;6700;329
31269;2020-07-06;7257;6700;329
31457;2020-07-07;7262;6700;329
31645;2020-07-08;7265;6800;329
31833;2020-07-09;7273;6800;329
32021;2020-07-10;7279;6800;329
32209;2020-07-11;7291;6800;329
32397;2020-07-12;7294;6800;329
32585;2020-07-13;7295;6800;329
32773;2020-07-14;7301;6800;329
32961;2020-07-15;7296;6880;328
33149;2020-07-16;7293;6880;328
33337;2020-07-17;7301;6880;328
33525;2020-07-18;7318;6880;328
33713;2020-07-19;7335;6880;328
33901;2020-07-20;7340;6880;328
34089;2020-07-21;7351;6880;328
34277;2020-07-22;7362;6920;328
34465;2020-07-23;7372;6920;328
34653;2020-07-24;7380;6920;329
34841;2020-07-25;7388;6920;329
35029;2020-07-26;7393;6920;329
35217;2020-07-27;7398;6920;329
35405;2020-07-28;7404;6920;329
35593;2020-07-29;7414;6950;329
35781;2020-07-30;7423;6950;329
35969;2020-07-31;7432;6950;329
36157;2020-08-01;7443;6950;329
36345;2020-08-02;7453;6950;329
36533;2020-08-03;7466;6950;329
36721;2020-08-04;7483;6950;331
36909;2020-08-05;7512;6980;331
37097;2020-08-06;7532;6980;331
37285;2020-08-07;7554;6980;331
Licensing
[edit]- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 15:42, 9 August 2020 | 804 × 462 (46 KB) | Merikanto (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 642.96pt |
---|---|
Height | 369.36pt |