本系列赛题、数据获取:
2021年暑假数学建模模拟赛(赛题+数据+分析)
不直接提供论文等资料,分析已经很详细了
整理不易,欢迎点赞+关注+收藏

2021年暑假数学建模第一次模拟赛:新冠疫情预测(插值,时间序列,微分方程建模)

1.赛题

处理数据是现代大数据时代的一项非常重要的工作,尤其数据的恢复和归类整理技术,更是关键与核心 。
本题目附带一份残缺数据表(见附件 ),表中所提供的数据,是自去年新冠疫情爆发以来 ,直到今年 2月,某平台公布的部分国家(共 19 个国家,国家名已经隐去)的疫情数据 。为了 论文建模的需要 ,其中有些数据已经被特意删除, 数据表的第一行是对应国家大约人口。由于人工输入数据 的客观事实 ,不排除某些国家上报的数据滞后 ,使得平台公布的个别数据 出现异常 ,需要各个队伍完成以下的任务:
A.检查表中是否有异常数据, 有哪些是?如何修改 ?
B.对于这19个国家,大部分都有局部数据缺失,请对缺失的数据作恢复。
C.对于国家04、国家07 、国家12 、国家17,对它们的起源数据进行恢复。
D.根据已有数据 ,对所有国家在今年3月6日~12日的疫情做出预测 。
E.对这19个国家进行两种以上形式的分类,并给出分类的依据和结果 。

2.思路

A.检查表中 是否有异常数据, 有哪些是?如何修改 ?

B.对于这19个国家,大部分都有局部数据缺失,请对缺失的数据作恢复。

通过观察,可以发现异常总共有三种类型

1.某些国家上报的数据滞后,新增数据异常,有些为0,实际是因为上报滞后

2.某些国家上一天的累计确诊+当天的累计确诊 ≠ 当天的累计确诊

3.对于累计型数据,某些国家出现了非单调的情况,当天数据小于前一天数据

使用程序检测异常数据点,人工复查删除挖空

然后使用分段插值

为什么使用分段插值?

为了避免龙格现象的产生。

在计算方法中,有利用多项式对某一函数的近似逼近,计算相应的函数值。例如,在事先不知道某一函数的具体形式的情况下,只能测量得知某一些分散的函数值。例如我们不知道气温随日期变化的具体函数关系,但是我们可以测量一些孤立的日期的气温值,并假定此气温随日期变化的函数满足某一多项式。这样,利用已经测的数据,应用待定系数法便可以求得一个多项式函数f(x)。应用此函数就可以计算或预测其他日期的气温值。一般情况下,多项式的次数越多,利用的数据就越多,而预测也就越准确。

例外发生了:龙格在研究多项式插值的时候,发现有的情况下,并非取节点(日期数)越多多项式就越精确。例如f(x)=1/(1+25x^2),它的插值函数在两个端点处发生剧烈的波动,造成较大的误差。

所以应该取附近的值进行插值

然而,实际编程为了省事,我并没有分段插值,正式赛可能会有心思弄弄

而且也只处理了2 3两种情况

C.对于国家04、国家07 、国家12 、国家17,对它们的起源数据进行恢复。

使用拟合,根据SIR传染病模型,我们知道在起源的时候其呈现J型曲线增长,因此拟合指数函数即可

其实拟合SIR模型、SIER模型也可以,但是效果好像不是很好,计算出来的方程式不太准,需要微调很麻烦,为了省事直接拟合简单函数

D.根据已有数据 ,对所有国家在今年3月6日~12日的疫情做出预测 。

第三节会提到Kaggle上的一项数据科学赛事COVID 19 Global Forecasting,会有具体提到模型选择。

根据week5的高分结果,最佳的主要是一些ensemble learning的机器学习模型,几个XGBoost、LightBGM用来用去,树套树套树

但是为了模型的可解释性,选择了时间序列预测模型Prophet,该模型由Facebook开发,相较于ARIMA有较大提高

E.对这19个国家进行两种以上形式的分类,并给出分类的依据和结果 。

参考文献

基于谱系聚类的全球各国新冠疫情时间序列特征分析

COVID-19暴发以来,世界各国疫情呈现出不同的时序特点,研究不同国家疫情发展模式的特点,揭示其背后的主导因素,可为未来防控策略提供参考。为了揭示不同国家疫情时间序列之间的异同,本文提取了主要疫情国家每日新增病例时间序列的标准差、Hurst指数、治愈率、增长时长、平均增长率、防控效率进行谱系聚类,并从经济、医疗、人文冲突方面对聚类结果进行了成因分析。结果表明,全球疫情发展模式可分为3大类:C型、S型和I型。C型国家时间序列的特点是持续波动上涨,治愈率较低,原因是其人文冲突不利于疫情防控,经济医疗资源经过长时间大量消耗已趋于匮乏,建议在防控中加强宣传疏导,改变观念,统筹分配经济、医疗资源;S型国家时间序列的特点是快速上升后立即下降,并最终保持稳定趋势,总体治愈率较高,其原因是这类国家国内稳定,经济医疗水平较高,以及防控措施及时,建议加强国际合作和科学研究,并为可能到来的二次疫情做好准备;I型国家时间序列特点是缓慢上涨,整体发展趋势不稳定,治愈率较低,原因是其暴发比较晚,程度较小,大部分经济医疗水平以及人文冲突不利于疫情防控,建议汲取较好的防控经验,实施严格的隔离措施,尽量满足疫情期间物资需求,优化治疗方法。

主要思路是构造时间序列特征,然后谱系聚类

然后使用肘部法则确定最佳聚类簇个数,确定最终结果

肘部法则:畸变程度的改善效果下降幅度最大的位置就是肘部,一般用畸变程度来确定最佳的值。

畸变程度:每个类别距离其该类中心点的距离称为畸变程度

不是正式赛,为了省事,只选了六个比较简单的时序特征聚类,也没有用肘部法则

选择了极差、标准差、均值、偏度、峰度和时间序列的自相关系数
都看到这里了,点个赞再走啊

3.Kaggle:COVID 19 Global Forecasting

kaggle是一个数据科学竞赛的平台,和国内阿里的天池平台差不多(其实Kaggle是全球最著名的平台,比天池知名的多)

数据分析师基本都知道这几个数据科学平台

Kaggle是全球范围内最大的数据众包平台。

企业或者研究者与Kaggle合作之后,可以将数据、问题描述、期望的指标发布到Kaggle上,以竞赛的形式向广大的数据科学家征集解决方案,类似于KDD-CUP(国际知识发现和数据挖掘竞赛)。

Kaggle上的参赛者将数据下载下来,分析数据,然后运用机器学习、数据挖掘等知识,建立算法模型,解决问题得出结果,最后将结果提交,如果提交的结果符合指标要求并且在参赛者中排名第一,将获得比赛丰厚的奖金。

在新冠疫情的时候,Kaggle曾推出了一系列的公益的新冠相关的数据科学竞赛

COVID 19 Global Forecasting就是这一系列数据科学竞赛中的一个,数据分析师通过对历史数据的分析,给出下一周全球所有国家新冠的疫情发展预测

Background

The White House Office of Science and Technology Policy (OSTP) pulled together a coalition research groups and companies (including Kaggle) to prepare the COVID-19 Open Research Dataset (CORD-19) to attempt to address key open scientific questions on COVID-19. Those questions are drawn from National Academies of Sciences, Engineering, and Medicine’s (NASEM) and the World Health Organization (WHO).

The Challenge

Kaggle is launching a companion COVID-19 forecasting challenges to help answer a subset of the NASEM/WHO questions. While the challenge involves developing quantile estimates intervals for confirmed cases and fatalities between May 12 and June 7 by region, the primary goal isn’t only to produce accurate forecasts. It’s also to identify factors that appear to impact the transmission rate of COVID-19.

You are encouraged to pull in, curate and share data sources that might be helpful. If you find variables that look like they impact the transmission rate, please share your finding in a notebook.

As the data becomes available, we will update the leaderboard with live results based on data made available from the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).

We have received support and guidance from health and policy organizations in launching these challenges. We’re hopeful the Kaggle community can make valuable contributions to developing a better understanding of factors that impact the transmission of COVID-19.

Companies and Organizations

There is also a call to action for companies and other organizations: If you have datasets that might be useful, please upload them to Kaggle’s dataset platform and reference them in this forum thread. That will make them accessible to those participating in this challenge and a resource to the wider scientific community.

Acknowledgements

JHU CSSE for making the data available to the public. The White House OSTP for pulling together the key open questions. The image comes from the Center for Disease Control.

该活动进行了5周,可以看到第五周的时候,数据分析师提交的模型已经相较于第一周有了非常大的进步,最佳方案的LMSE从1降到了0.28

其中效果比较好的几种模型方案是

1.树类模型,如XGBoostRegressor,效果最佳,一个树套树集成学习的方案拿下了全场最佳。但是这样的模型可解释性不强,而且有data_leakage的风险

2.时间序列类模型,ARIMA等模型。本文就是使用Prophet,由Facebook提出,效果优于经典模型

3.传染病模型类,SIR,SEIR,特别难调,而且得逐个国家分析

4.拟合类,有人用改良的加入时序信息的指数线性回归,效果还不错。还有人用了Lasso和多项式拟合也还行

5.深度学习类模型,主要是循环神经网络类。但是其实数据集还是比较少的

值得highlight的几个不错的notebook

1.The Story of COVID-19 in India EDA and Prediction

作者做了探索性数据分析,并分析了很多模型在预测方面的效果

2.COVID Global Forecast: SIR model + ML regressions

Kaggle上的高赞notebook,结合SIR使用回归拟合方法预测,并且分析详实,可做第三问

有作者写的SIR的求解功能函数

3.COVID-19 Global Forecast : SEIR + Visualize

LMSE达到了0.3,非常的不错,但是调参,极度复杂

SEIR的正确用法

4.Covid-19 Forecasting XGBOOST(week-4) 30dace

效果最佳的树类模型,但是可解释性不强,预测最准

4.程序

A.检查表中是否有异常数据, 有哪些是?如何修改 ?

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from pandas_profiling import ProfileReport
#画出每列的图并保存图
def plot_results(ddata,alp):font = FontProperties(fname = "simsun.ttc", size=15)for i in range(76):plt.subplot(19, 4, i+1)ax = ddata.iloc[:,i].plot(figsize = (16*4 ,12*19))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[i]],errj[i],'r^',markersize=10)fig = ax.get_figure()#fig.savefig(str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')#plt.clf()fig.savefig(alp + '.png')plt.clf()for i in range(4):for j in range(19):plt.subplot(5, 4, j+1)#print(j * 4 + i)ax = ddata.iloc[j * 4 + i,:].plot(figsize = (16*5 ,12*4))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[j*4 + i]],errj[j*4 + i],'r^',markersize=10)fig = ax.get_figure()fig.savefig(alp+cl[i%4]+'.png')plt.clf()for i in range(76):ax = ddata.iloc[i].plot(figsize = (16,12))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)fig = ax.get_figure()fig.savefig(alp+str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')plt.clf()
data = pd.read_csv('data.csv',index_col = 0)#,header = None)
data.index = pd.to_datetime(data.index)
datanp = np.asarray(data)
cl = ['新增确诊','累计确诊','累计治愈','累计死亡']
report = ProfileReport(data)
#使用pandas_report库进行EDA探索性数据分析
report.to_file(output_file='EDA.html')
Summarize dataset:   0%|          | 0/90 [00:00<?, ?it/s]/home/anaconda3/lib/python3.8/site-packages/missingno/missingno.py:250: UserWarning: FixedFormatter should only be used together with FixedLocatorax1.set_xticklabels(ax1.get_xticklabels(), rotation=45, ha='right', fontsize=fontsize)
/home/anaconda3/lib/python3.8/site-packages/pandas_profiling/model/summary.py:194: UserWarning: There was an attempt to generate the bar missing values diagrams, but this failed.To hide this warning, disable the calculation(using `df.profile_report(missing_diagrams={"bar": False}`)If this is problematic for your use case, please report this as an issue:https://github.com/pandas-profiling/pandas-profiling/issues(include the error message: 'The number of FixedLocator locations (7), usually from a call to set_ticks, does not match the number of ticklabels (77).')warnings.warn(Generate report structure:   0%|          | 0/1 [00:00<?, ?it/s]Render HTML:   0%|          | 0/1 [00:00<?, ?it/s]Export report to file:   0%|          | 0/1 [00:00<?, ?it/s]

plot_results(data.T,'a')
<Figure size 1152x864 with 0 Axes>
datanp[np.isnan(datanp)] = -1
#检测异常数据并输出
err = [[] for i in range(76)]
errj = [[] for i in range(76)]
tot = 1
datanpT = datanp.T
flag = -1
for i in range(len(datanpT)-1):for j in range(1,len(datanpT[i])):if datanpT[i][j] == -1 or datanpT[i+1][j] == -1 or datanpT[i][j] == -1 or datanpT[i+1][j-1] == -1:continueif i % 4 == 0 and datanpT[i+1][j] != datanpT[i][j] + datanpT[i+1][j-1]:err[i].append(j)#print(err,j)errj[i].append(datanpT[i][j])print(tot,data.index[j].strftime('%Y-%m-%d'),'第'+str(int(i/4)+1)+'个国家',cl[i%4],'附近可能有异常,附近值为:',datanpT[i+1][j],' != ',datanpT[i][j],' + ',datanpT[i+1][j-1],'!新增确诊型错误!!!!!!!!!!')tot += 1elif i % 4 != 0 and datanpT[i][j] < datanpT[i][j-1]:err[i].append(j)#print(err,j)errj[i].append(datanpT[i][j])print(tot,data.index[j].strftime('%Y-%m-%d'),'第'+str(int(i/4)+1)+'个国家',cl[i%4],'附近可能有异常,附近值为:',datanpT[i][j-1],' > ',datanpT[i][j],'#累计型数据错误##########')tot += 1
1 2021-02-08 第1个国家 累计治愈 附近可能有异常,附近值为: 2440706.0  >  2429273.0 #累计型数据错误##########
2 2020-08-12 第1个国家 累计死亡 附近可能有异常,附近值为: 5873.0  >  3513.0 #累计型数据错误##########
3 2020-09-28 第1个国家 累计死亡 附近可能有异常,附近值为: 7997.0  >  6466.0 #累计型数据错误##########
4 2020-10-30 第2个国家 累计死亡 附近可能有异常,附近值为: 34113.0  >  24478.0 #累计型数据错误##########
5 2020-06-03 第3个国家 累计治愈 附近可能有异常,附近值为: 44946.0  >  21325.0 #累计型数据错误##########
6 2020-06-05 第3个国家 累计治愈 附近可能有异常,附近值为: 21605.0  >  21305.0 #累计型数据错误##########
7 2020-08-30 第3个国家 累计治愈 附近可能有异常,附近值为: 381183.0  >  283584.0 #累计型数据错误##########
8 2020-12-21 第3个国家 累计死亡 附近可能有异常,附近值为: 16154.0  >  15197.0 #累计型数据错误##########
9 2020-10-06 第4个国家 累计治愈 附近可能有异常,附近值为: 625684.0  >  616857.0 #累计型数据错误##########
10 2020-12-21 第4个国家 累计死亡 附近可能有异常,附近值为: 24691.0  >  14907.0 #累计型数据错误##########
11 2021-02-09 第5个国家 累计治愈 附近可能有异常,附近值为: 361813.0  >  262062.0 #累计型数据错误##########
12 2020-07-01 第5个国家 累计死亡 附近可能有异常,附近值为: 7649.0  >  1698.0 #累计型数据错误##########
13 2020-07-28 第6个国家 新增确诊 附近可能有异常,附近值为: 389717.0  !=  13756.0  +  389717.0 !新增确诊型错误!!!!!!!!!!
14 2020-09-16 第6个国家 新增确诊 附近可能有异常,附近值为: 738020.0  !=  4160.0  +  738020.0 !新增确诊型错误!!!!!!!!!!
15 2020-03-25 第6个国家 累计治愈 附近可能有异常,附近值为: 2.0  >  1.0 #累计型数据错误##########
16 2020-06-21 第6个国家 累计治愈 附近可能有异常,附近值为: 143017.0  >  141967.0 #累计型数据错误##########
17 2020-06-25 第6个国家 累计治愈 附近可能有异常,附近值为: 151589.0  >  151225.0 #累计型数据错误##########
18 2021-03-05 第6个国家 累计治愈 附近可能有异常,附近值为: 1250047.0  >  1248642.0 #累计型数据错误##########
19 2020-08-09 第8个国家 新增确诊 附近可能有异常,附近值为: 361442.0  !=  4507.0  +  361442.0 !新增确诊型错误!!!!!!!!!!
20 2021-03-02 第8个国家 累计确诊 附近可能有异常,附近值为: 3204531.0  >  3130184.0 #累计型数据错误##########
21 2020-05-27 第8个国家 累计死亡 附近可能有异常,附近值为: 28752.0  >  27117.0 #累计型数据错误##########
22 2020-06-19 第9个国家 累计确诊 附近可能有异常,附近值为: 238159.0  >  238011.0 #累计型数据错误##########
23 2020-02-25 第9个国家 累计治愈 附近可能有异常,附近值为: 2.0  >  1.0 #累计型数据错误##########
24 2020-06-25 第9个国家 累计治愈 附近可能有异常,附近值为: 186111.0  >  175103.0 #累计型数据错误##########
25 2020-08-31 第9个国家 累计治愈 附近可能有异常,附近值为: 208536.0  >  207653.0 #累计型数据错误##########
26 2020-10-16 第9个国家 累计治愈 附近可能有异常,附近值为: 245964.0  >  2564.0 #累计型数据错误##########
27 2020-11-01 第9个国家 累计治愈 附近可能有异常,附近值为: 289426.0  >  282380.0 #累计型数据错误##########
28 2020-12-29 第9个国家 累计治愈 附近可能有异常,附近值为: 1408686.0  >  142530.0 #累计型数据错误##########
29 2020-06-24 第9个国家 累计死亡 附近可能有异常,附近值为: 34675.0  >  34644.0 #累计型数据错误##########
30 2020-06-25 第9个国家 累计死亡 附近可能有异常,附近值为: 34644.0  >  10130.0 #累计型数据错误##########
31 2020-10-11 第9个国家 累计死亡 附近可能有异常,附近值为: 36410.0  >  36166.0 #累计型数据错误##########
32 2020-10-17 第9个国家 累计死亡 附近可能有异常,附近值为: 43519.0  >  36474.0 #累计型数据错误##########
33 2020-03-31 第10个国家 累计治愈 附近可能有异常,附近值为: 15.0  >  0.0 #累计型数据错误##########
34 2020-06-08 第10个国家 累计治愈 附近可能有异常,附近值为: 11348.0  >  11189.0 #累计型数据错误##########
35 2020-09-25 第10个国家 累计治愈 附近可能有异常,附近值为: 15913.0  >  15813.0 #累计型数据错误##########
36 2021-01-21 第10个国家 累计死亡 附近可能有异常,附近值为: 3810.0  >  2830.0 #累计型数据错误##########
37 2020-04-05 第11个国家 累计治愈 附近可能有异常,附近值为: 636.0  >  633.0 #累计型数据错误##########
38 2020-07-19 第11个国家 累计治愈 附近可能有异常,附近值为: 271239.0  >  254941.0 #累计型数据错误##########
39 2020-08-05 第11个国家 累计治愈 附近可能有异常,附近值为: 357444.0  >  341764.0 #累计型数据错误##########
40 2020-11-11 第11个国家 累计治愈 附近可能有异常,附近值为: 824355.0  >  736197.0 #累计型数据错误##########
41 2020-10-10 第11个国家 累计死亡 附近可能有异常,附近值为: 93096.0  >  83497.0 #累计型数据错误##########
42 2020-12-09 第12个国家 累计确诊 附近可能有异常,附近值为: 432179.0  >  426142.0 #累计型数据错误##########
43 2020-10-03 第12个国家 累计治愈 附近可能有异常,附近值为: 298955.0  >  298593.0 #累计型数据错误##########
44 2021-01-23 第12个国家 累计治愈 附近可能有异常,附近值为: 482771.0  >  467886.0 #累计型数据错误##########
45 2021-03-02 第12个国家 累计治愈 附近可能有异常,附近值为: 645371.0  >  547406.0 #累计型数据错误##########
46 2021-01-23 第12个国家 累计死亡 附近可能有异常,附近值为: 11204.0  >  10190.0 #累计型数据错误##########
47 2020-04-06 第13个国家 累计确诊 附近可能有异常,附近值为: 5389.0  >  4363.0 #累计型数据错误##########
48 2021-01-01 第13个国家 累计治愈 附近可能有异常,附近值为: 3527722.0  >  2553467.0 #累计型数据错误##########
49 2020-11-09 第13个国家 累计死亡 附近可能有异常,附近值为: 38833.0  >  30546.0 #累计型数据错误##########
50 2021-02-19 第13个国家 累计死亡 附近可能有异常,附近值为: 80587.0  >  71048.0 #累计型数据错误##########
51 2020-07-22 第14个国家 累计治愈 附近可能有异常,附近值为: 48466.0  >  46790.0 #累计型数据错误##########
52 2020-07-13 第14个国家 累计死亡 附近可能有异常,附近值为: 3606.0  >  3565.0 #累计型数据错误##########
53 2020-07-29 第15个国家 新增确诊 附近可能有异常,附近值为: 208546.0  !=  386.0  +  207707.0 !新增确诊型错误!!!!!!!!!!
54 2020-06-10 第15个国家 累计确诊 附近可能有异常,附近值为: 186309.0  >  176522.0 #累计型数据错误##########
55 2020-03-20 第15个国家 累计治愈 附近可能有异常,附近值为: 135.0  >  115.0 #累计型数据错误##########
56 2021-01-23 第15个国家 累计治愈 附近可能有异常,附近值为: 1901518.0  >  1816566.0 #累计型数据错误##########
57 2020-07-06 第15个国家 累计死亡 附近可能有异常,附近值为: 9023.0  >  9022.0 #累计型数据错误##########
58 2020-07-26 第15个国家 累计死亡 附近可能有异常,附近值为: 9124.0  >  6124.0 #累计型数据错误##########
59 2020-07-15 第16个国家 新增确诊 附近可能有异常,附近值为: 22880.0  !=  18.0  +  22431.0 !新增确诊型错误!!!!!!!!!!
60 2020-07-28 第16个国家 新增确诊 附近可能有异常,附近值为: 32096.0  !=  1009.0  +  31116.0 !新增确诊型错误!!!!!!!!!!
61 2020-07-29 第16个国家 新增确诊 附近可能有异常,附近值为: 33362.0  !=  11.0  +  32096.0 !新增确诊型错误!!!!!!!!!!
62 2020-04-16 第16个国家 累计确诊 附近可能有异常,附近值为: 8626.0  >  8526.0 #累计型数据错误##########
63 2020-09-17 第16个国家 累计治愈 附近可能有异常,附近值为: 68110.0  >  68109.0 #累计型数据错误##########
64 2020-10-31 第16个国家 累计治愈 附近可能有异常,附近值为: 91184.0  >  89765.0 #累计型数据错误##########
65 2020-09-06 第17个国家 累计确诊 附近可能有异常,附近值为: 118045.0  >  109784.0 #累计型数据错误##########
66 2020-09-07 第17个国家 累计治愈 附近可能有异常,附近值为: 102304.0  >  91242.0 #累计型数据错误##########
67 2020-12-22 第18个国家 累计治愈 附近可能有异常,附近值为: 1374401.0  >  137926.0 #累计型数据错误##########
68 2021-02-25 第18个国家 累计治愈 附近可能有异常,附近值为: 1882568.0  >  1776732.0 #累计型数据错误##########
69 2020-03-31 第18个国家 累计死亡 附近可能有异常,附近值为: 80.0  >  26.0 #累计型数据错误##########
70 2020-10-20 第18个国家 累计死亡 附近可能有异常,附近值为: 27716.0  >  27100.0 #累计型数据错误##########
71 2020-11-24 第19个国家 累计治愈 附近可能有异常,附近值为: 101981.0  >  12103.0 #累计型数据错误##########

B.对于这19个国家,大部分都有局部数据缺失,请对缺失的数据作恢复

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.interpolate as spi
from matplotlib.font_manager import FontProperties
def plot_results(ddata,alp):font = FontProperties(fname = "simsun.ttc", size=15)for i in range(76):plt.subplot(19, 4, i+1)ax = ddata.iloc[:,i].plot(figsize = (16*4 ,12*19))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[i]],errj[i],'r^',markersize=10)fig = ax.get_figure()#fig.savefig(str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')#plt.clf()fig.savefig(alp + '.png')plt.clf()for i in range(4):for j in range(19):plt.subplot(5, 4, j+1)#print(j * 4 + i)ax = ddata.iloc[j * 4 + i,:].plot(figsize = (16*5 ,12*4))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[j*4 + i]],errj[j*4 + i],'r^',markersize=10)fig = ax.get_figure()fig.savefig(alp+cl[i%4]+'.png')plt.clf()for i in range(76):ax = ddata.iloc[i].plot(figsize = (16,12))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)fig = ax.get_figure()fig.savefig(alp+str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')plt.clf()
data = pd.read_csv('data2.csv',index_col = 0, header = None)
data.index = pd.to_datetime(data.index)
datanp = np.asarray(data)
datanpT = datanp.T
cl = ['新增确诊','累计确诊','累计治愈','累计死亡']
def get_nan_pos(x):flag = Truea = b = 0for i in range(len(x)):f = np.isnan(x[i])if flag and not f:a = iflag = Falseelif not flag and not f:b = ireturn a,b
#三次样条插值主程序
for i in range(len(datanpT)):if i % 4 != 0:a,b = get_nan_pos(datanpT[i])test = datanpT[i][a:b+1]X = [i for i in range(len(test)) if not np.isnan(test[i])]Xnew = [i for i in range(len(test))] test0 = [x for x in test if str(x) != 'nan']xtk =spi.splrep(X,test0,k=3)testnew=spi.splev(Xnew,xtk)testnew = [int(x+0.5) for x in testnew]datanpT[i][a:b+1] = testnewfor i in range(len(datanpT)):if i % 4 == 0:for j in range(len(datanpT[0])):if np.isnan(datanpT[i][j]) and not np.isnan(datanpT[i+1][j]) and not np.isnan(datanpT[i+1][j-1]):datanpT[i][j] = datanpT[i+1][j] - datanpT[i+1][j-1]
datapd = pd.DataFrame(datanpT.T,index = data.index)
datapd.to_csv('datab.csv')
plot_results(datapd.T,'b')
<Figure size 1152x864 with 0 Axes>

C.对于国家04、国家07 、国家12 、国家17,对它们的起源数据进行恢复

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from fbprophet import Prophet
import seaborn as sns
from sklearn import preprocessing
import time
from datetime import datetime
from scipy import integrate, optimize
import warnings
warnings.filterwarnings('ignore')
import xgboost as xgb
from xgboost import plot_importance, plot_tree
from sklearn.model_selection import RandomizedSearchCV, GridSearchCV
from sklearn import linear_model
from sklearn.metrics import mean_squared_error
def plot_results(ddata,alp):font = FontProperties(fname = "simsun.ttc", size=15)for i in range(76):plt.subplot(19, 4, i+1)ax = ddata.iloc[:,i].plot(figsize = (16*4 ,12*19))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[i]],errj[i],'r^',markersize=10)fig = ax.get_figure()#fig.savefig(str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')#plt.clf()fig.savefig(alp + '.png')plt.clf()for i in range(4):for j in range(19):plt.subplot(5, 4, j+1)#print(j * 4 + i)ax = ddata.iloc[j * 4 + i,:].plot(figsize = (16*5 ,12*4))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[j*4 + i]],errj[j*4 + i],'r^',markersize=10)fig = ax.get_figure()fig.savefig(alp+cl[i%4]+'.png')plt.clf()for i in range(76):ax = ddata.iloc[i].plot(figsize = (16,12))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)fig = ax.get_figure()fig.savefig(alp+str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')plt.clf()
def get_nan_pos(x):flag = Truea = b = 0for i in range(len(x)):f = np.isnan(x[i])if flag and not f:a = iflag = Falseelif not flag and not f:b = ireturn a,b
data = pd.read_csv('datab.csv',index_col = 0)
data.index = pd.to_datetime(data.index)
datanp = np.asarray(data)
datanpT = datanp.T
cl = ['新增确诊','累计确诊','累计治愈','累计死亡']
#拟合函数功能
def fund(x, a, b):return x**a + bdef exp(a,b,c):popt, pcov = optimize.curve_fit(fund, np.arange(a,b+1), datanpT[c,a:b+1])y2 = [fund(i, popt[0],popt[1]) for i in np.arange(a)]print(popt)return y2
#拟合函数主程序
def process(x):for i in range(1,4):col = ( x - 1 ) * 4 + ia,b = get_nan_pos(datanpT[col])res = exp(a,b,col)for j in range(a):datanpT[col][j] = 0 if int(res[j]) < 0 else int(res[j])plt.plot(datanpT[col])col = ( x - 1 ) * 4for j in range(a + 1):if np.isnan(datanpT[col][j]) and not np.isnan(datanpT[col+1][j]) and not np.isnan(datanpT[col+1][j-1]):datanpT[col][j] = datanpT[col+1][j] - datanpT[col+1][j-1]plt.plot(datanpT[col])
process(4)
[2.35488959e+00 2.08163995e+05]
[2.34072715e+00 1.62728660e+05]
[ 1.82234028e+00 -7.76740348e+03]

process(7)
[1.94416793e+00 8.79005660e+03]
[1.88752533e+00 2.52925313e+03]
[  1.32832738 313.35107076]

process(12)
[2.16711557e+00 1.62686890e+05]
[2.14909405e+00 1.54557091e+05]
[   1.55969654 1145.01889887]

process(17)
[2.06556968e+00 4.88594367e+04]
[2.03906768e+00 3.92166091e+04]
[1.56742707e+00 4.75658372e+03]

datapd = pd.DataFrame(datanpT.T,index = data.index)
datapd.to_csv('datac.csv')
plot_results(datapd.T,'c')
<Figure size 1152x864 with 0 Axes>
#画论文用的示例图
def fund(x, a, b):return x**a + b
c = 13
a, b = get_nan_pos(datanpT[c])
plt.plot(np.arange(a,b+1),datanpT[c,a:b+1],'b-')
popt, pcov = optimize.curve_fit(fund, np.arange(a,b+1), datanpT[c,a:b+1])
y2 = [fund(i, popt[0],popt[1]) for i in np.arange(b+1)]
plt.plot(np.arange(b+1),y2,'r--')
print(popt)
[2.35488967e+00 2.08163556e+05]

D.根据已有数据 ,对所有国家在今年3月6日~12日的疫情做出预测

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from fbprophet import Prophet
def plot_results(ddata,alp):font = FontProperties(fname = "simsun.ttc", size=15)for i in range(76):plt.subplot(19, 4, i+1)ax = ddata.iloc[:,i].plot(figsize = (16*4 ,12*19))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[i]],errj[i],'r^',markersize=10)fig = ax.get_figure()#fig.savefig(str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')#plt.clf()fig.savefig(alp + '.png')plt.clf()for i in range(4):for j in range(19):plt.subplot(5, 4, j+1)#print(j * 4 + i)ax = ddata.iloc[j * 4 + i,:].plot(figsize = (16*5 ,12*4))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[j*4 + i]],errj[j*4 + i],'r^',markersize=10)fig = ax.get_figure()fig.savefig(alp+cl[i%4]+'.png')plt.clf()for i in range(76):ax = ddata.iloc[i].plot(figsize = (16,12))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)fig = ax.get_figure()fig.savefig(alp+str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')plt.clf()
def get_nan_pos(x):flag = Truea = b = 0for i in range(len(x)):f = np.isnan(x[i])if flag and not f:a = iflag = Falseelif not flag and not f:b = ireturn a,b
data = pd.read_csv('datac.csv',index_col = 0)
data.index = pd.to_datetime(data.index)
datanp = np.asarray(data)[:-7]
datanpT = datanp.T
cl = ['新增确诊','累计确诊','累计治愈','累计死亡']
#Prophet主程序
pred = np.zeros((76,7))
for i in range(len(datanpT)):if i % 4 != 0:a,b = get_nan_pos(datanpT[i])test = datanpT[i][a:b+1]data2 = pd.DataFrame(columns = ['ds','y'])data2['ds'] = data.index[a:b+1]data2['y'] = pd.DataFrame(test)prop=Prophet()prop.fit(data2)future=prop.make_future_dataframe(periods=7)prop_forecast=prop.predict(future)forecast = prop_forecast['yhat'].tail(7)for j in range(7):pred[i][j] = int(np.asarray(forecast).tolist()[j])
INFO:numexpr.utils:NumExpr defaulting to 6 threads.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
datanpT = np.hstack((datanpT,pred))
for i in range(len(datanpT)):if i % 4 == 0:for j in range(len(datanpT[0])):if np.isnan(datanpT[i][j]) and not np.isnan(datanpT[i+1][j]) and not np.isnan(datanpT[i+1][j-1]):datanpT[i][j] = datanpT[i+1][j] - datanpT[i+1][j-1]
datapd = pd.DataFrame(datanpT.T,index = data.index)
datapd.to_csv('datad.csv')
plot_results(datapd.T,'d')
<Figure size 1152x864 with 0 Axes>
i = 1
a,b = get_nan_pos(datanpT[i])
test = datanpT[i][a:b+1]
data2 = pd.DataFrame(columns = ['ds','y'])
data2['ds'] = data.index[a:b+1]
data2['y'] = pd.DataFrame(test)prop=Prophet()
prop.fit(data2)
future=prop.make_future_dataframe(periods=7)
prop_forecast=prop.predict(future)
forecast = prop_forecast['yhat'].tail(7)for j in range(7):pred[i][j] = int(np.asarray(forecast).tolist()[j])
fig1 = prop.plot(prop_forecast)
print(fig1)
INFO:fbprophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this.
INFO:fbprophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.Figure(720x432)

E.对这19个国家进行两种以上形式的分类,并给出分类的依据和结果

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
from fbprophet import Prophet
def plot_results(ddata,alp):font = FontProperties(fname = "simsun.ttc", size=15)for i in range(76):plt.subplot(19, 4, i+1)ax = ddata.iloc[:,i].plot(figsize = (16*4 ,12*19))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[i]],errj[i],'r^',markersize=10)fig = ax.get_figure()#fig.savefig(str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')#plt.clf()fig.savefig(alp + '.png')plt.clf()for i in range(4):for j in range(19):plt.subplot(5, 4, j+1)#print(j * 4 + i)ax = ddata.iloc[j * 4 + i,:].plot(figsize = (16*5 ,12*4))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)#plt.plot(data.index[err[j*4 + i]],errj[j*4 + i],'r^',markersize=10)fig = ax.get_figure()fig.savefig(alp+cl[i%4]+'.png')plt.clf()for i in range(76):ax = ddata.iloc[i].plot(figsize = (16,12))ax.set_title('第'+str(int(i/4)+1)+'个国家 '+cl[i%4], fontproperties=font)ax.set_xlabel('时间', fontproperties=font)ax.set_ylabel('人数', fontproperties=font)fig = ax.get_figure()fig.savefig(alp+str(i)+'第'+str(int(i/4)+1)+'个国家 '+cl[i%4]+'.png')plt.clf()
def get_nan_pos(x):flag = Truea = b = 0for i in range(len(x)):f = np.isnan(x[i])if flag and not f:a = iflag = Falseelif not flag and not f:b = ireturn a,b
data = pd.read_csv('datad.csv',index_col = 0)
data.index = pd.to_datetime(data.index)
datanp = np.asarray(data)[:-7]
datanpT = datanp.T
cl = ['新增确诊','累计确诊','累计治愈','累计死亡']
#时间序列指标构造
popu = [8434, 8399, 1912, 5931, 3481, 3297, 4385, 4735, 5955, 691, 12893, 22089, 14410, 27352, 8324, 12584, 1764, 4538, 10233]
zb = np.zeros((19,6*4 + 1))
for i in range(19):a,b = get_nan_pos(datanpT[i])for j in range(4):zb[i][j * 6] = (data.iloc[a:b+1,i * 4 + j].max() - data.iloc[a:b+1,i * 4 + j].min())/popu[1]zb[i][j * 6 + 1] = data.iloc[a:b+1,i * 4 + j].std()/popu[1]zb[i][j * 6 + 2] = data.iloc[a:b+1,i * 4 + j].mean()/popu[1]zb[i][j * 6 + 3] = data.iloc[a:b+1,i * 4 + j].skew()zb[i][j * 6 + 4] = data.iloc[a:b+1,i * 4 + j].kurt()zb[i][j * 6 + 5] = data.iloc[a:b+1,i * 4 + j].autocorr(1)
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from scipy.spatial.distance import pdist,squareform
from scipy.cluster.hierarchy import dendrogram, linkage,fcluster
y=pdist(zb,'cityblock')
yc=squareform(y)
#层次聚类
z=linkage(y)
dendrogram(z)
{'icoord': [[55.0, 55.0, 65.0, 65.0],[45.0, 45.0, 60.0, 60.0],[95.0, 95.0, 105.0, 105.0],[85.0, 85.0, 100.0, 100.0],[75.0, 75.0, 92.5, 92.5],[52.5, 52.5, 83.75, 83.75],[35.0, 35.0, 68.125, 68.125],[25.0, 25.0, 51.5625, 51.5625],[145.0, 145.0, 155.0, 155.0],[175.0, 175.0, 185.0, 185.0],[165.0, 165.0, 180.0, 180.0],[150.0, 150.0, 172.5, 172.5],[135.0, 135.0, 161.25, 161.25],[125.0, 125.0, 148.125, 148.125],[115.0, 115.0, 136.5625, 136.5625],[38.28125, 38.28125, 125.78125, 125.78125],[15.0, 15.0, 82.03125, 82.03125],[5.0, 5.0, 48.515625, 48.515625]],'dcoord': [[0.0, 84.35553265031531, 84.35553265031531, 0.0],[0.0, 93.15248493698107, 93.15248493698107, 84.35553265031531],[0.0, 110.07644521228045, 110.07644521228045, 0.0],[0.0, 132.09467729006676, 132.09467729006676, 110.07644521228045],[0.0, 157.29288712699466, 157.29288712699466, 132.09467729006676],[93.15248493698107,164.2858816178837,164.2858816178837,157.29288712699466],[0.0, 178.32839892931258, 178.32839892931258, 164.2858816178837],[0.0, 213.79407917024827, 213.79407917024827, 178.32839892931258],[0.0, 68.3166911324183, 68.3166911324183, 0.0],[0.0, 68.98316307507751, 68.98316307507751, 0.0],[0.0, 86.4678808239903, 86.4678808239903, 68.98316307507751],[68.3166911324183, 91.2931701078218, 91.2931701078218, 86.4678808239903],[0.0, 133.6322571551408, 133.6322571551408, 91.2931701078218],[0.0, 255.88167544403163, 255.88167544403163, 133.6322571551408],[0.0, 258.37290412622247, 258.37290412622247, 255.88167544403163],[213.79407917024827,271.7272701302869,271.7272701302869,258.37290412622247],[0.0, 529.6448790324241, 529.6448790324241, 271.7272701302869],[0.0, 560.1345748317412, 560.1345748317412, 529.6448790324241]],'ivl': ['0','12','3','7','13','1','5','8','14','10','17','2','11','6','4','15','9','16','18'],'leaves': [0, 12, 3, 7, 13, 1, 5, 8, 14, 10, 17, 2, 11, 6, 4, 15, 9, 16, 18],'color_list': ['C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C0','C0'],'leaves_color_list': ['C0','C0','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1','C1']}

(m,n)=zb.shape
d = np.zeros((m,m))
for i in range(m):for j in range(i+1,m):d[i,j]=sum(map(abs,(zb[i,:]-zb[j,:])))
nd=d.ravel()[np.flatnonzero(d)]
nd=np.unique(nd)
l=len(nd)
for i in range(0,l):nd_min=min(nd)(row,col)=np.where(d==nd_min)tm=np.union1d(row,col)print('第{:d}次合成,平台高度为{}时的分类结果为:{}'.format(i+1,nd_min,tm))nd=np.delete(nd,np.where(nd==min(nd)))if(not len(nd)):break
第1次合成,平台高度为68.3166911324183时的分类结果为:[ 4 15]
第2次合成,平台高度为68.98316307507754时的分类结果为:[16 18]
第3次合成,平台高度为84.35553265031534时的分类结果为:[1 5]
第4次合成,平台高度为86.46788082399028时的分类结果为:[ 9 18]
第5次合成,平台高度为91.29317010782178时的分类结果为:[ 9 15]
第6次合成,平台高度为93.15248493698107时的分类结果为:[ 5 13]
第7次合成,平台高度为102.94998792781072时的分类结果为:[15 18]
第8次合成,平台高度为104.9501276755348时的分类结果为:[15 16]
第9次合成,平台高度为110.07644521228046时的分类结果为:[10 17]
第10次合成,平台高度为110.49573252178976时的分类结果为:[ 4 16]
第11次合成,平台高度为112.26228953600875时的分类结果为:[ 4 18]
第12次合成,平台高度为120.97508109266569时的分类结果为:[4 9]
第13次合成,平台高度为126.04076736881537时的分类结果为:[ 9 16]
第14次合成,平台高度为132.09467729006673时的分类结果为:[14 17]
第15次合成,平台高度为133.63225715514082时的分类结果为:[ 6 18]
第16次合成,平台高度为137.15119837436262时的分类结果为:[ 6 16]
第17次合成,平台高度为150.447216649573时的分类结果为:[ 1 13]
第18次合成,平台高度为157.29288712699466时的分类结果为:[ 8 14]
第19次合成,平台高度为164.28588161788366时的分类结果为:[ 1 10]
第20次合成,平台高度为178.32839892931256时的分类结果为:[7 8]
第21次合成,平台高度为183.8271613417955时的分类结果为:[6 9]
第22次合成,平台高度为206.60228828870424时的分类结果为:[10 14]
第23次合成,平台高度为213.7940791702483时的分类结果为:[3 5]
第24次合成,平台高度为223.56111620654693时的分类结果为:[ 1 17]
第25次合成,平台高度为224.12115186722247时的分类结果为:[ 6 15]
第26次合成,平台高度为233.21928597368145时的分类结果为:[ 5 10]
第27次合成,平台高度为238.4763056806507时的分类结果为:[ 8 17]
第28次合成,平台高度为242.89272560401645时的分类结果为:[4 6]
第29次合成,平台高度为255.88167544403166时的分类结果为:[ 4 11]
第30次合成,平台高度为258.37290412622247时的分类结果为:[ 2 11]
第31次合成,平台高度为271.7272701302869时的分类结果为:[ 2 13]
第32次合成,平台高度为277.743527248323时的分类结果为:[ 3 13]
第33次合成,平台高度为279.4486801988989时的分类结果为:[2 4]
第34次合成,平台高度为279.5409406068438时的分类结果为:[11 15]
第35次合成,平台高度为280.0704096818501时的分类结果为:[1 3]
第36次合成,平台高度为280.14734491839135时的分类结果为:[2 3]
第37次合成,平台高度为282.92277406932857时的分类结果为:[ 5 17]
第38次合成,平台高度为292.12114533067256时的分类结果为:[ 7 14]
第39次合成,平台高度为292.236200299266时的分类结果为:[ 1 14]
第40次合成,平台高度为295.41643676588717时的分类结果为:[11 16]
第41次合成,平台高度为301.2948835098816时的分类结果为:[ 6 11]
第42次合成,平台高度为306.7048114520455时的分类结果为:[ 4 13]
第43次合成,平台高度为309.49627760484884时的分类结果为:[ 8 10]
第44次合成,平台高度为311.19219571849106时的分类结果为:[ 2 15]
第45次合成,平台高度为312.8547394592049时的分类结果为:[10 13]
第46次合成,平台高度为317.6965339083655时的分类结果为:[2 5]
第47次合成,平台高度为330.60935047536975时的分类结果为:[ 2 16]
第48次合成,平台高度为331.85758422828746时的分类结果为:[13 15]
第49次合成,平台高度为337.12127783361177时的分类结果为:[2 6]
第50次合成,平台高度为350.21441963409575时的分类结果为:[ 9 11]
第51次合成,平台高度为354.1577402722106时的分类结果为:[11 18]
第52次合成,平台高度为361.10511206689455时的分类结果为:[ 5 14]
第53次合成,平台高度为363.7868394338214时的分类结果为:[13 17]
第54次合成,平台高度为368.58867834656706时的分类结果为:[2 9]
第55次合成,平台高度为378.90437797099327时的分类结果为:[4 5]
第56次合成,平台高度为381.88646736109985时的分类结果为:[1 2]
第57次合成,平台高度为387.24178910586704时的分类结果为:[ 2 18]
第58次合成,平台高度为387.81677773539263时的分类结果为:[ 9 13]
第59次合成,平台高度为392.0930090048729时的分类结果为:[ 7 17]
第60次合成,平台高度为400.5777445014364时的分类结果为:[ 3 10]
第61次合成,平台高度为405.5306390778874时的分类结果为:[13 16]
第62次合成,平台高度为413.2113414573384时的分类结果为:[13 18]
第63次合成,平台高度为419.16726071400274时的分类结果为:[ 5 15]
第64次合成,平台高度为423.1181149572522时的分类结果为:[ 3 11]
第65次合成,平台高度为431.06159914253294时的分类结果为:[13 14]
第66次合成,平台高度为432.2970105982587时的分类结果为:[ 7 10]
第67次合成,平台高度为437.17287535422287时的分类结果为:[1 8]
第68次合成,平台高度为444.60409034578856时的分类结果为:[1 4]
第69次合成,平台高度为452.82159776408395时的分类结果为:[ 3 17]
第70次合成,平台高度为470.9032332559021时的分类结果为:[5 9]
第71次合成,平台高度为477.4747330422423时的分类结果为:[ 1 15]
第72次合成,平台高度为480.48774450141957时的分类结果为:[ 5 16]
第73次合成,平台高度为486.8822291651393时的分类结果为:[ 5 18]
第74次合成,平台高度为498.4412072216778时的分类结果为:[11 13]
第75次合成,平台高度为505.55987541927107时的分类结果为:[5 8]
第76次合成,平台高度为527.0333285948866时的分类结果为:[1 7]
第77次合成,平台高度为529.6448790324241时的分类结果为:[ 8 12]
第78次合成,平台高度为530.7681539834398时的分类结果为:[1 9]
第79次合成,平台高度为533.948223094708时的分类结果为:[ 3 14]
第80次合成,平台高度为541.4806835465时的分类结果为:[ 6 13]
第81次合成,平台高度为544.1239971839619时的分类结果为:[ 1 16]
第82次合成,平台高度为544.185744595734时的分类结果为:[ 2 10]
第83次合成,平台高度为551.7118550630462时的分类结果为:[ 1 18]
第84次合成,平台高度为559.499633187458时的分类结果为:[3 4]
第85次合成,平台高度为560.1345748317411时的分类结果为:[0 8]
第86次合成,平台高度为571.661267384654时的分类结果为:[ 7 12]
第87次合成,平台高度为573.6018469629098时的分类结果为:[ 5 11]
第88次合成,平台高度为578.7830226236664时的分类结果为:[ 8 13]
第89次合成,平台高度为579.7241863264254时的分类结果为:[ 3 15]
第90次合成,平台高度为598.5310406399919时的分类结果为:[ 2 17]
第91次合成,平台高度为605.7749650317012时的分类结果为:[5 7]
第92次合成,平台高度为605.9305848552207时的分类结果为:[ 0 14]
第93次合成,平台高度为606.5261026870522时的分类结果为:[ 3 16]
第94次合成,平台高度为607.3990360339529时的分类结果为:[ 4 10]
第95次合成,平台高度为613.3785395513823时的分类结果为:[3 6]
第96次合成,平台高度为616.7649147688885时的分类结果为:[5 6]
第97次合成,平台高度为625.2210609388632时的分类结果为:[ 7 13]
第98次合成,平台高度为632.4952558152643时的分类结果为:[ 1 11]
第99次合成,平台高度为639.7514543932722时的分类结果为:[3 9]
第100次合成,平台高度为640.540247956008时的分类结果为:[10 15]
第101次合成,平台高度为646.2405182521588时的分类结果为:[0 7]
第102次合成,平台高度为659.3849053637615时的分类结果为:[ 4 17]
第103次合成,平台高度为661.794687762312时的分类结果为:[3 8]
第104次合成,平台高度为666.2413963137113时的分类结果为:[ 3 18]
第105次合成,平台高度为667.517989446433时的分类结果为:[ 2 14]
第106次合成,平台高度为675.3179001980416时的分类结果为:[ 0 17]
第107次合成,平台高度为677.7903187642676时的分类结果为:[12 14]
第108次合成,平台高度为680.2977140817345时的分类结果为:[1 6]
第109次合成,平台高度为693.2156276625117时的分类结果为:[ 9 10]
第110次合成,平台高度为695.5862994014643时的分类结果为:[15 17]
第111次合成,平台高度为706.4913310670964时的分类结果为:[10 16]
第112次合成,平台高度为714.0612716958293时的分类结果为:[10 18]
第113次合成,平台高度为733.412556895125时的分类结果为:[ 4 14]
第114次合成,平台高度为734.728152746857时的分类结果为:[3 7]
第115次合成,平台高度为741.7338196661748时的分类结果为:[12 17]
第116次合成,平台高度为748.2632151693596时的分类结果为:[ 9 17]
第117次合成,平台高度为750.6759566959627时的分类结果为:[14 15]
第118次合成,平台高度为757.8748223916938时的分类结果为:[16 17]
第119次合成,平台高度为762.5849195511998时的分类结果为:[0 3]
第120次合成,平台高度为766.9728163144206时的分类结果为:[17 18]
第121次合成,平台高度为772.241185333593时的分类结果为:[ 0 10]
第122次合成,平台高度为794.4151422588006时的分类结果为:[10 11]
第123次合成,平台高度为813.3427973197112时的分类结果为:[ 9 14]
第124次合成,平台高度为815.8823442506714时的分类结果为:[2 8]
第125次合成,平台高度为833.3019585906997时的分类结果为:[14 16]
第126次合成,平台高度为834.9543973937224时的分类结果为:[10 12]
第127次合成,平台高度为840.2391367615819时的分类结果为:[14 18]
第128次合成,平台高度为842.4413795409534时的分类结果为:[ 6 10]
第129次合成,平台高度为847.7699720274637时的分类结果为:[2 7]
第130次合成,平台高度为851.0350233885503时的分类结果为:[11 17]
第131次合成,平台高度为881.776880337987时的分类结果为:[4 8]
第132次合成,平台高度为885.3346971447055时的分类结果为:[0 1]
第133次合成,平台高度为893.6016720585168时的分类结果为:[ 6 17]
第134次合成,平台高度为907.9058431292721时的分类结果为:[ 8 15]
第135次合成,平台高度为912.7165877511585时的分类结果为:[4 7]
第136次合成,平台高度为918.7012820334081时的分类结果为:[11 14]
第137次合成,平台高度为928.7019538548334时的分类结果为:[ 7 15]
第138次合成,平台高度为950.231807960737时的分类结果为:[0 5]
第139次合成,平台高度为955.9593065331903时的分类结果为:[ 1 12]
第140次合成,平台高度为963.7419423919812时的分类结果为:[8 9]
第141次合成,平台高度为969.2521543038945时的分类结果为:[ 6 14]
第142次合成,平台高度为981.1210264116131时的分类结果为:[ 8 16]
第143次合成,平台高度为987.9198697932658时的分类结果为:[ 0 12]
第144次合成,平台高度为988.2834049489155时的分类结果为:[ 8 18]
第145次合成,平台高度为988.3560323561115时的分类结果为:[ 7 16]
第146次合成,平台高度为993.5152803251326时的分类结果为:[7 9]
第147次合成,平台高度为1018.1275177138418时的分类结果为:[ 0 13]
第148次合成,平台高度为1019.4583508774123时的分类结果为:[ 7 18]
第149次合成,平台高度为1022.5590375892714时的分类结果为:[ 5 12]
第150次合成,平台高度为1034.4893520719272时的分类结果为:[0 2]
第151次合成,平台高度为1066.4259036662074时的分类结果为:[ 0 11]
第152次合成,平台高度为1067.0656624061671时的分类结果为:[ 8 11]
第153次合成,平台高度为1084.6774481535674时的分类结果为:[ 7 11]
第154次合成,平台高度为1095.8467203700006时的分类结果为:[12 13]
第155次合成,平台高度为1117.0711664987382时的分类结果为:[6 8]
第156次合成,平台高度为1124.4846466098604时的分类结果为:[6 7]
第157次合成,平台高度为1180.971511122478时的分类结果为:[ 3 12]
第158次合成,平台高度为1313.8415495568756时的分类结果为:[0 4]
第159次合成,平台高度为1332.3517840822067时的分类结果为:[ 0 15]
第160次合成,平台高度为1334.2757254133417时的分类结果为:[ 2 12]
第161次合成,平台高度为1360.8639898680758时的分类结果为:[ 0 16]
第162次合成,平台高度为1367.7204781002613时的分类结果为:[0 6]
第163次合成,平台高度为1393.1590978089935时的分类结果为:[0 9]
第164次合成,平台高度为1399.6984389407216时的分类结果为:[ 4 12]
第165次合成,平台高度为1420.5833229270677时的分类结果为:[ 0 18]
第166次合成,平台高度为1427.0047749451378时的分类结果为:[12 15]
第167次合成,平台高度为1481.0365724681756时的分类结果为:[ 9 12]
第168次合成,平台高度为1497.7845682513487时的分类结果为:[12 16]
第169次合成,平台高度为1506.2049689460146时的分类结果为:[12 18]
第170次合成,平台高度为1584.9873207446913时的分类结果为:[11 12]
第171次合成,平台高度为1633.7346127199612时的分类结果为:[ 6 12]

155时的分类结果为:[ 8 18]
第145次合成,平台高度为988.3560323561115时的分类结果为:[ 7 16]
第146次合成,平台高度为993.5152803251326时的分类结果为:[7 9]
第147次合成,平台高度为1018.1275177138418时的分类结果为:[ 0 13]
第148次合成,平台高度为1019.4583508774123时的分类结果为:[ 7 18]
第149次合成,平台高度为1022.5590375892714时的分类结果为:[ 5 12]
第150次合成,平台高度为1034.4893520719272时的分类结果为:[0 2]
第151次合成,平台高度为1066.4259036662074时的分类结果为:[ 0 11]
第152次合成,平台高度为1067.0656624061671时的分类结果为:[ 8 11]
第153次合成,平台高度为1084.6774481535674时的分类结果为:[ 7 11]
第154次合成,平台高度为1095.8467203700006时的分类结果为:[12 13]
第155次合成,平台高度为1117.0711664987382时的分类结果为:[6 8]
第156次合成,平台高度为1124.4846466098604时的分类结果为:[6 7]
第157次合成,平台高度为1180.971511122478时的分类结果为:[ 3 12]
第158次合成,平台高度为1313.8415495568756时的分类结果为:[0 4]
第159次合成,平台高度为1332.3517840822067时的分类结果为:[ 0 15]
第160次合成,平台高度为1334.2757254133417时的分类结果为:[ 2 12]
第161次合成,平台高度为1360.8639898680758时的分类结果为:[ 0 16]
第162次合成,平台高度为1367.7204781002613时的分类结果为:[0 6]
第163次合成,平台高度为1393.1590978089935时的分类结果为:[0 9]
第164次合成,平台高度为1399.6984389407216时的分类结果为:[ 4 12]
第165次合成,平台高度为1420.5833229270677时的分类结果为:[ 0 18]
第166次合成,平台高度为1427.0047749451378时的分类结果为:[12 15]
第167次合成,平台高度为1481.0365724681756时的分类结果为:[ 9 12]
第168次合成,平台高度为1497.7845682513487时的分类结果为:[12 16]
第169次合成,平台高度为1506.2049689460146时的分类结果为:[12 18]
第170次合成,平台高度为1584.9873207446913时的分类结果为:[11 12]
第171次合成,平台高度为1633.7346127199612时的分类结果为:[ 6 12]

2021年暑假数学建模第一次模拟赛:新冠疫情预测(插值,时间序列,微分方程建模)相关推荐

  1. 《30天吃掉那只 TensorFlow2.0》 1-4 时间序列数据建模流程范例 (国内新冠疫情结束时间预测问题)

    1-4 时间序列数据建模流程范例 (国内新冠疫情结束时间预测问题) 文章目录 1-4 时间序列数据建模流程范例 (国内新冠疫情结束时间预测问题) 一,准备数据 二,定义模型 三,训练模型 四,评估模型 ...

  2. 2021年暑假数学建模第三次模拟赛:全国各省人均消费分析与预测(很好的SPSS统计训练)

    本系列赛题.数据获取: 2021年暑假数学建模模拟赛(赛题+数据+分析) 不直接提供论文等资料,分析已经很详细了 整理不易,欢迎点赞+关注+收藏 赛题 分析 这次的赛题完全可以全用SPSS来实现,以前 ...

  3. Python小白的数学建模课-A3. 12个新冠疫情数模竞赛赛题与点评

    新冠疫情深刻和全面地影响着社会和生活,已经成为数学建模竞赛的背景帝. 收集了与新冠疫情相关的的数学建模竞赛赛题,关注收藏本文或者在评论区留下邮箱,送你赛题分析点评及优秀论文. 『Python小白的数学 ...

  4. 2021年10月8日模拟赛(保龄奇遇记)

    本场考试考的很撇,值得反思,暴露出很多问题,望及时的拨乱反正,改掉操之过急,心态不稳定的缺点 2021年10月8日模拟赛(保龄奇遇记) 太菜了 T1 话中有话 有些词是多义词.这就导致同一句话可能有多 ...

  5. Python小白的数学建模课-B5. 新冠疫情 SEIR模型

    传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. 考虑存在易感者.暴露者.患病者和康复者四类人群,适用于具有潜伏期.治愈后获得终身免疫的传染病. 本 ...

  6. Python小白的数学建模课-B3. 新冠疫情 SIS模型

    传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. SIS 模型型将人群分为 S 类和 I 类,考虑患病者可以治愈而变成易感者,但不考虑免疫期. 本文 ...

  7. Python小白的数学建模课-B6. 新冠疫情 SEIR 改进模型

    传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. SEIR 模型考虑存在易感者.暴露者.患病者和康复者四类人群,适用于具有潜伏期.治愈后获得终身免疫 ...

  8. Python小白的数学建模课-B2. 新冠疫情 SI模型

    传染病的数学模型是数学建模中的典型问题,常见的传染病模型有 SI.SIR.SIRS.SEIR 模型. SI 模型是最简单的传染病模型,适用于只有易感者和患病者两类人群. 我们就从 SI 模型开始吧,从 ...

  9. 2022年认证杯SPSSPRO杯数学建模C题(第一阶段)污水流行病学原理在新冠疫情防控方面的作用求解全过程文档及程序

    2022年认证杯SPSSPRO杯数学建模 C题 污水流行病学原理在新冠疫情防控方面的作用 原题再现:   2019 年新型冠状病毒肺炎疫情暴发至今已过两年,新型冠状病毒历经多次变异,目前已有 11 种 ...

最新文章

  1. stackoverflow上一个最会举例子的专家
  2. linux系统级别的能够打开的文件句柄的数file-max命令
  3. 布隆过滤器速度_布隆过滤器的分析和实现
  4. Java设计模式(十八):享元设计模式
  5. CentOS下设置服务自动启动的方法
  6. 撩课-Python-每天5道面试题-第2天
  7. 虚拟机7.1.4序列号
  8. html2image乱码问题,HtmlImageGenerator字体乱码问题解决、html2image放linux上乱码问题解决...
  9. shell循环和分支
  10. ASP.NET MVC5+EF6+EasyUI 后台管理系统(52)-美化EasyUI皮肤和图标
  11. C语言之指针本身地址与指针向的地址(四十四)
  12. 190313每日一句
  13. TFS2010安装全过程
  14. 腐蚀rust服务器系统,腐蚀rust有哪些服务器命令 腐蚀rust服务器命令一览
  15. 用ArrayList实现简单队列和栈
  16. Alert Log中“Fatal NI connect error 12170”错误
  17. Android实现用户圆形头像和模糊背景设计
  18. java面试笔记整理
  19. SLF4J(六) - MDC/MDCAdapter是什么?
  20. 做一个专属于自己的图灵机器人

热门文章

  1. 鸿蒙系统体验手机机,香香的鸿蒙系统体验机:荣耀9X
  2. 消防也有大“智慧”,智慧消防助力传统消防产业升级
  3. linux 卸载模块命令,linux卸载内核模块命令是什么
  4. Makeblock程小奔成为日本STEAM教师研修计划首选编程机器人
  5. 设计模式之内功心法 SOLID五大原则
  6. 大数据时代征信业发展探析
  7. 冰shader_干货 | UnityShader Demo01之冰块材质
  8. vue3 vscode插件volar配置
  9. [oeasy]python0120_英语的崛起_英文字符_小写字母的由来_不列颠帝国
  10. 《C语言及程序设计》实践参考——个人所得税计算器switch语句版