File:R-luvun vaikutus tartuntojen kasvuun 1.svg
Original file (SVG file, nominally 1,004 × 481 pixels, file size: 49 KB)
This is a file from the Wikimedia Commons. Information from its description page there is shown below. Commons is a freely licensed media file repository. You can help. |
Summary
DescriptionR-luvun vaikutus tartuntojen kasvuun 1.svg |
Suomi: R-luvun vaikutus tartuntojen kasvuun. |
Date | |
Source | Own work |
Author | Merikanto |
Python code to create this plotting
-
- covid 19 finland epidemy R0 and time to peak simu test
- 8.3.2021 0000.0001
-
import math as math
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
from matplotlib.ticker import NullFormatter
from matplotlib.dates import MonthLocator, DateFormatter
alkupaivamaara='2021-03-05' ## simulaation alkupvm
aikamaara=46
tapauksia_alussa=750
times1 = pd.date_range(alkupaivamaara , periods=aikamaara, freq='D')
- 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
- maara=60
maara=aikamaara
- 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, aikamaara):
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=tapauksia_alussa
huippuaika=40
ro=1.35
laskuro=1.35
tau=5.0
tapauksiayhteensa=[]
ax = plt.gca()
fig = plt.gcf()
fig.set_size_inches(11, 7, forward=True)
for m in range(0, 3):
ro=1.15+0.1*m
laskuro=ro
tapauksia=750
for n in range(0, aikamaara):
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
paivays1=times1[n].strftime("%d.%m.")
jono1="R "+str(round(ro,3))+ " Tartuntoja "+paivays1 +" : "+str(int(y[n])) + " tartuntoja yht. "+str(int(cy[n-1]) )
tapauksiayhteensa.append(int(cy[n-1]))
plt.plot(times1,y, label=jono1)
- plt.plot(x,dy)
- plt.plot(x,y)
laapeli1="Tartuntoja alussa "+str(tapauksia_alussa)
plt.title("R-luvun vaikutus tartuntojen kasvuun", fontsize=20)
plt.suptitle(laapeli1, fontsize=14,y=1)
plt.xlabel("Päivämäärä ", fontsize=16)
plt.ylabel("Tartuntoja päivässä", fontsize=16)
plt.xticks(fontsize=15 )
plt.yticks(fontsize=15 )
ax.xaxis.set_major_formatter(mdates.DateFormatter('%d.%m.'))
plt.legend(fontsize=14)
plt.show()
Licensing
- 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.
Items portrayed in this file
depicts
8 March 2021
image/svg+xml
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 10:42, 8 March 2021 | 1,004 × 481 (49 KB) | Merikanto | Update | |
08:54, 8 March 2021 | 900 × 560 (46 KB) | Merikanto | Uploaded own work with UploadWizard |
File usage
Metadata
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Width | 802.8pt |
---|---|
Height | 384.48pt |