数据来源:
国家卫健委
已经7连降咯!
1.20-2.10图示(更新中):
神经网络训练并预测数据:
clear %除湖北以外全国新增确诊病例数 2020.1.20-2.9 num=[5,44,62,154,264,365,398,480,619,705,762,728,669,726,890,731,707,696,558,509,444]; date=[1.20,1.21,1.22,1.23,1.24,1.25,1.26,1.27,1.28,1.29,1.30,1.31,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9]; time=1:1:21; %神经网络方法 t=1:1:25; net=newff([1,21],[100,1],{'tansig','purelin','traingd'}); net.trainParam.epochs=100; net.trainParam.goal=0; net.trainParam.show=50; net=train(net,time,num); Y=sim(net,t); %subplot(2,2,3); plot(time,num,'-',t,Y,'o'); Y
图示:
gd:
cg:
使用十种训练函数共得到十组数据。
BP网络神经训练函数:
使用梯度下降法(traingd)和共轭梯度法(traincg)等
最终平均展示:
clear %除湖北以外全国新增确诊病例数 2020.1.20-2.9 num=[5,44,62,154,264,365,398,480,619,705,762,728,669,726,890,731,707,696,558,509,444]; date=[1.20,1.21,1.22,1.23,1.24,1.25,1.26,1.27,1.28,1.29,1.30,1.31,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9]; time=1:1:21; new=[333.1634 333.1545 333.3438 309.6494 418.0459 418.0184 323.9634 323.9630 377.9053 377.9032 377.9032 363.2079 409.5222 356.2805 346.2917 331.5729 440.4060 348.9631 348.9040 348.9040 402.1017 432.6627 341.0351 331.3046 443.4262 363.5209 358.4212 358.4694 421.0171 419.9279 420.4641 420.4647 361.7637 246.7261 217.0827 217.0827 443.9999 443.9878 317.5077 291.0492]; a1=0;a2=0; a3=0;a4=0; for i=1:4:37 a1=a1+new(i); end a1=a1/10; for i=2:4:38 a2=a2+new(i); end a2=a2/10; for i=3:4:39 a3=a3+new(i); end a3=a3/10; for i=4:4:40 a4=a4+new(i); end a4=a4/10; num=[num,a1,a2,a3,a4]; time1=1:1:25; date1=[1.20,1.21,1.22,1.23,1.24,1.25,1.26,1.27,1.28,1.29,1.30,1.31,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,2.10,2.11,2.12,2.13]; plot(time1,num); text(time1,num,num2str([date1;num].','(%.2f,%.1f)')); grid on
图示:
结论:
拐点已经出现,未来几天除湖北外全国新增确诊人数将呈现维持在低位的动态变化。