? — .
, « ».COVID-19? ? – ? , ? : , ?
, . .
, , . , Python.
![](https://habrastorage.org/webt/fi/0x/4z/fi0x4z2nhcc3-3bdzugakb4csji.png)
COVID-19 — , SARS-CoV-2 (2019-nCoV). — , /, .
, , .
: |
, COVID-19 , . . . . , COVID-19 . - , . , . , , : 0,5% 3,5%.
, COVID-19.
. , , , , , , COVID-19 , , , . , , .. , .
, , , .
, ? !
, : , . , . .
![](https://habrastorage.org/webt/fk/vb/tz/fkvbtzvxfe9er8qkz61m8hetxda.png)
COVID-19 7 . , , , 29 50 !
![](https://habrastorage.org/webt/1u/sv/zw/1usvzwfpxrpn9dyndk-sunfw9t4.png)
? 2837 . ?
, , .
, , (, ). .
, , , , . . . , – , ( , ).
![](https://habrastorage.org/webt/dd/hc/mz/ddhcmzvkjymbgapewtcaef_ssam.png)
,
. . – , . , .
– . . . . . – .
( ). . , , . (, , ), ( ). , . , , , . , 1969 .
. ( ).
, .
![](https://habrastorage.org/webt/c0/tk/vg/c0tkvgoh4o0cntc6gafitccgrwk.png)
. – , . , . , . , . , .
![](https://habrastorage.org/webt/0h/mk/8j/0hmk8jmrydjdkj5yfzbmvvdmmqw.png)
, . , , . , . , – .
, , – , . , , «» . , , – . .
, , . . , .
, , , , . – .
?
«»: , . , , , , , .
![](https://habrastorage.org/webt/kq/pd/cn/kqpdcnj60_gqx3d1eyjk5jdyvy0.png)
![](https://habrastorage.org/webt/nh/g8/c8/nhg8c8raapabzh6zc-kxoixuxya.png)
![](https://habrastorage.org/webt/1e/_o/aa/1e_oaa-lhxdon3wmhrgdvrpe5cg.png)
![](https://habrastorage.org/webt/km/yi/56/kmyi56l_s-qfonmmzmj_ujyzmss.png)
![](https://habrastorage.org/webt/nj/af/pi/njafpi3z06ne1s3ev7xvbj9ik8e.png)
![](https://habrastorage.org/webt/l2/3e/gz/l23egzxly46j1qzgxbxk0wxiay0.png)
, COVID-19 :
– 19 ,
– 4 ,
– 15 .
, , 2,6 .
![](https://habrastorage.org/webt/6s/ac/oa/6sacoa7u4oeithlvflpdbfmrvwo.png)
![](https://habrastorage.org/webt/9c/ah/bd/9cahbdchwjdh-tiyfkycyw3lihy.png)
, , , , . , :
– 2,5 ,
– 1,1 ,
– 2,2 .
![](https://habrastorage.org/webt/zz/f3/yu/zzf3yutu4cdu0cg4tvwyfn1sme8.png)
![](https://habrastorage.org/webt/la/vy/vd/lavyvd144s2e43_lasa35c44kzg.png)
![](https://habrastorage.org/webt/-w/yi/_n/-wyi_n-a7habwzx-8quy9kzkmy8.png)
![](https://habrastorage.org/webt/vk/kv/nz/vkkvnzox0w3vntgy4rjze54-kmw.png)
![](https://habrastorage.org/webt/5q/vv/ic/5qvvicdfgqjxwkb73v-dpqp3amw.png)
![](https://habrastorage.org/webt/tq/7y/lp/tq7ylpv_th6b9qjv7mceuwf-_5u.png)
-
, . 23 .
![](https://habrastorage.org/webt/je/hp/zu/jehpzu1fj-we8etcxqxup-2jq_0.png)
![](https://habrastorage.org/webt/ny/6n/dw/ny6ndwvsvepquniosyonyom71ew.png)
– ?
, . .
![](https://habrastorage.org/webt/r5/o7/-r/r5o7-rr4wwgy_-aay6xjkgynpca.png)
![](https://habrastorage.org/webt/ph/rc/-k/phrc-kzxmfru6hqwcgnlyxyazzq.png)
![](https://habrastorage.org/webt/nl/gt/nr/nlgtnrklz72ptup0iowesx8lt7a.png)
![](https://habrastorage.org/webt/so/nk/xk/sonkxk3bhaaqd3mo8wn-my_ht84.png)
. :
, , .
. 25.03 1 , 01.04 – 8 , 33 . .
, . , , « ». , , , , , – .
, . .
?
.
![](https://habrastorage.org/webt/x3/dg/gy/x3dggyi1bcq9y-za3ksorcyv4yi.png)
![](https://habrastorage.org/webt/yr/-j/lk/yr-jlk2asbvfhrffg-u-xzbpuvk.png)
: , . 1 800 .
, , .
, .
![](https://habrastorage.org/webt/gb/8d/m9/gb8dm94dk6h74fzirc7x_fbfdzo.png)
, , ( ). , . , , 0,029% . (, , , , , ) 0,007% — 4 .
, . , , , . , , , . . , , , . , , .
, 2 100 . – 900 .
, , , .
, 1-2 , 2 .
?
, 148 ( , ) 10 . ( , ) – 40 .
10 . , : , , ( ), , . -- .
, . . , , , .
, 40-60 . 30 , 10-30 .
?
, , , : , ?
58 . 2 , , 3,5%. , . , . , .
, , , . , 300 650 , .
: COVID-19 – . . , . . , – . , . , , . , . , 10 , !
, . , . 0,4-0,5% .
0,4-0,5% . , . . , , , . , , - , . 3,5%.
0,4-0,5% — 28-35 . , , . , , , . . .
. , , . , . , , , -, . , , , , -, , .
, . . , , , .
, , , , . , , .
Python Jupiter scipy, numpy, pandas, datetime. matplotlib.pyplot.
Excel. 4 .
.
, , :
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
from IPython.display import display
import scipy as sp
from datetime import datetime
from scipy.optimize import minimize
DataFrame. Timestamp. , numpy, DataFrame , Timestamp , .
corona = pd.read_csv('D:/coronavirus.csv',sep=";")
corona.set_index('Date', inplace=True)
corona.index = pd.to_datetime(corona.index)
DataFrame Series, . – , . .
X = corona['X']
chi = corona['China']
fr = corona['France']
ir = corona['Iran']
it = corona['Italy']
sp = corona['Spain']
uk = corona['UK']
us = corona['US']
bg = corona['Belgium']
gm = corona['Germany']
nt = corona['Netherlands']
sw = corona['Switzerland']
tot = corona['Total']
numpy . , 1 , Series.
dchi = chi[1:].values - chi[:-1].values
dfr = fr[1:].values - fr[:-1].values
dit = it[1:].values - it[:-1].values
diran = ir[1:].values - ir[:-1].values
dsp = sp[1:].values - sp[:-1].values
duk = uk[1:].values - uk[:-1].values
dus = us[1:].values - us[:-1].values
dbg = bg[1:].values - bg[:-1].values
dgm = gm[1:].values - gm[:-1].values
dnt = nt[1:].values - nt[:-1].values
dsw = sw[1:].values - sw[:-1].values
dtot = tot[1:].values - tot[:-1].values
. , 20 , 180 17 . Timestamp .
X_long = np.arange(20, 200)
time_long = pd.date_range('2020-01-20', periods=180)
resLogistic, 3 , – .
def resLogistic(coefficents):
A0 = coefficents[0]
A1 = coefficents[1]
A2 = coefficents[2]
teor = A0 / (1 + np.exp(A1 * (X.ravel() - A2)))
return np.sum((teor - chi) ** 2)
. 3 . ( Python ) , , – .
teor – , , chi – . .
minimize scipy.optimize , . , .
, minimize . ( , dtot, ). minimize , .
mimim.x – .
minim = minimize(resLogistic, [3200, -.16, 46])
minim.x
, , .
plt.figure(figsize=(15,10))
teorChi = minim.x[0] / (1 + np.exp(minim.x[1] * (X_long - minim.x[2])))
plt.plot(X,chi,'ro', label=' ')
plt.plot(X_long[:80], teorChi[:80],'b', label=' ')
plt.xticks(X_long[:80][::2], time_long.date[:80][::2], rotation='90');
plt.title(' , ', Size=20);
plt.ylabel(' ')
plt.legend()
plt.grid()
![](https://habrastorage.org/webt/c0/tk/vg/c0tkvgoh4o0cntc6gafitccgrwk.png)
( ), ( ).
plt.figure(figsize = (15,10))
plt.grid()
plt.title(' , ', Size=20);
plt.plot(X[1:], dchi, 'r', Marker='o', label=' ')
plt.xticks(X_long[1:120][::3], time_long.date[1:120][::3], rotation='90');
plt.plot(X_long[1:120], teorChi[1:120] - teorChi[:119],'b', label=' ')
plt.ylabel(' ')
plt.legend()
![](https://habrastorage.org/webt/0h/mk/8j/0hmk8jmrydjdkj5yfzbmvvdmmqw.png)
.
. minimize. , , , .
, , , . , , , .
def resLogisticIr(coefficents):
A0 = coefficents[0]
A1 = coefficents[1]
A2 = coefficents[2]
teor = A0 / (1 + np.exp(A1 * (X.ravel() - A2)))
return np.sum((teor - ir) ** 2)
minim = minimize(resLogisticIr, [3200, -.16, 80])
minim.x
plt.figure(figsize=(15,10))
teorIr = minim.x[0] / (1 + np.exp(minim.x[1] * (X_long - minim.x[2])))
plt.plot(X_long[:120], teorIr[:120],'b', label=' ')
plt.xticks(X_long[:120][::3], time_long.date[:120][::3], rotation='90');
plt.title(' , ', Size=20);
plt.plot(X,ir,'ro', label=' ')
plt.grid()
plt.legend()
plt.ylabel(' ')
![](https://habrastorage.org/webt/1e/_o/aa/1e_oaa-lhxdon3wmhrgdvrpe5cg.png)
plt.figure(figsize = (15,10))
plt.grid()
plt.title(' , ', Size=20);
plt.plot(X[1:], diran, 'r', Marker='o', label=' ')
plt.plot(X[1:], diran, 'ro')
plt.xticks(X_long[1:120][::3], time_long.date[1:120][::3], rotation='90');
plt.plot(X_long[1:120], teorIr[1:120] - teorIr[:119],'b', label=' ')
plt.ylabel(' ')
plt.legend()
![](https://habrastorage.org/webt/km/yi/56/kmyi56l_s-qfonmmzmj_ujyzmss.png)
def resLogisticIt(coefficents):
A0 = coefficents[0]
A1 = coefficents[1]
A2 = coefficents[2]
teor = A0 / (1 + np.exp(A1 * (X.ravel() - A2)))
return np.sum((teor - it) ** 2)
minim = minimize(resLogisticIt, [3200, -.16, 46])
minim.x
plt.figure(figsize=(15,10))
teorIt = minim.x[0] / (1 + np.exp(minim.x[1] * (X_long - minim.x[2])))
plt.plot(X,it,'ro', label=' ')
plt.plot(X_long[:120], teorIt[:120],'b', label=' ')
plt.xticks(X_long[:120][::3], time_long.date[:120][::3], rotation='90');
plt.title(' , ', Size=20);
plt.ylabel(' ')
plt.grid()
plt.legend()
![](https://habrastorage.org/webt/kq/pd/cn/kqpdcnj60_gqx3d1eyjk5jdyvy0.png)
plt.figure(figsize = (15,10))
plt.grid()
plt.title(' , ', Size=20);
plt.plot(X[1:], dit, 'r', Marker='o', label=' ')
plt.xticks(X_long[1:120][::3], time_long.date[1:120][::3], rotation='90');
plt.plot(X_long[1:120], teorIt[1:120] - teorIt[:119],'b', label=' ')
plt.ylabel(' ')
plt.legend()
![](https://habrastorage.org/webt/nh/g8/c8/nhg8c8raapabzh6zc-kxoixuxya.png)
def resLogisticSp(coefficents):
A0 = coefficents[0]
A1 = coefficents[1]
A2 = coefficents[2]
teor = A0 / (1 + np.exp(A1 * (X.ravel() - A2)))
return np.sum((teor - sp) ** 2)
minim = minimize(resLogisticSp, [3200, -.16, 80])
minim.x
plt.figure(figsize=(15,10))
teorSp = minim.x[0] / (1 + np.exp(minim.x[1] * (X_long - minim.x[2])))
plt.plot(X_long[:120], teorSp[:120],'b', label=' ')
plt.xticks(X_long[:120][::3], time_long.date[:120][::3], rotation='90');
plt.title(' , ', Size=20);
plt.plot(X,sp,'ro', label=' ')
plt.grid()
plt.legend()
plt.ylabel(' ')
![](https://habrastorage.org/webt/nj/af/pi/njafpi3z06ne1s3ev7xvbj9ik8e.png)
plt.figure(figsize = (15,10))
plt.grid()
plt.plot(X[1:], dsp, 'r', Marker='o', label=' ')
plt.plot(X[1:], dsp, 'ro')
plt.xticks(X_long[1:120][::3], time_long.date[1:120][::3], rotation='90');
plt.title(' , ', Size=20);
plt.plot(X_long[1:120], teorSp[1:120] - teorSp[:119],'b', label=' ')
plt.ylabel(' ')
plt.legend()
![](https://habrastorage.org/webt/l2/3e/gz/l23egzxly46j1qzgxbxk0wxiay0.png)
def resLogisticUs(coefficents):
A0 = coefficents[0]
A1 = coefficents[1]
A2 = coefficents[2]
teor = A0 / (1 + np.exp(A1 * (X.ravel() - A2)))
return np.sum((teor - us) ** 2)
minim = minimize(resLogisticUs, [3200, -.16, 100])
minim.x
plt.figure(figsize=(15,10))
teorUS = minim.x[0] / (1 + np.exp(minim.x[1] * (X_long - minim.x[2])))
plt.plot(X_long[:120], teorUS[:120],'b', label=' ')
plt.xticks(X_long[:120][::3], time_long.date[:120][::3], rotation='90');
plt.title(' , ', Size=20);
plt.plot(X,us,'ro', label=' ')
plt.grid()
plt.legend()
plt.ylabel(' ')
![](https://habrastorage.org/webt/je/hp/zu/jehpzu1fj-we8etcxqxup-2jq_0.png)
plt.figure(figsize = (15,10))
plt.grid()
plt.title(' , ', Size=20);
plt.plot(X[1:], dus, 'r', Marker='o', label=' ')
plt.plot(X[1:], dus, 'ro')
plt.xticks(X_long[1:120][::3], time_long.date[1:120][::3], rotation='90');
plt.plot(X_long[1:120], teorUS[1:120] - teorUS[:119],'b', label=' ')
plt.ylabel(' ')
plt.legend()
![](https://habrastorage.org/webt/ny/6n/dw/ny6ndwvsvepquniosyonyom71ew.png)