欢迎来到天天文库
浏览记录
ID:47012767
大小:103.50 KB
页数:22页
时间:2019-12-03
《matlab 常用算法大全》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Matlab高级算法程序代码汇总一、灰色预测模型matlab程序%renkou1=renkou(:,1);%年末常住人口数%renkou2=renkou(:,2);%户籍人口%renkou3=renkou(:,3);%非户籍人口%shjian=1979:2010;%以上数据自己给x0=renkou2';n=length(x0);lamda=x0(1:n-1)./x0(2:n)range=minmax(lamda)x1=cumsum(x0)fori=2:nz(i)=0.5*(x1(i)+x1(i-1));endB=[-z(2:n)',ones(n-1,1)];Y=x0(2:n)';u=B
2、Yx=dsolve('Dx+a*x=b','x(0)=x0');x=subs(x,{'a','b','x0'},{u(1),u(2),x1(1)});yuce1=subs(x,'t',[0:n-1]);digits(6),y=vpa(x)%为提高预测精度,先计算预测值,再显示微分方程的解yuce=[x0(1),diff(yuce1)]epsilon=x0-yuce%计算残差delta=abs(epsilon./x0)%计算相对误差rho=1-(1-0.5*u(1))/(1+0.5*u(1))*lamda%计算级比偏差值%以深圳人口数据得到预测模型及预测误差相关数据lamda=Column
3、s1through80.97410.96110.94190.87490.93110.90930.93020.9254Columns9through160.92450.92780.94420.93760.91270.91480.93320.9477Columns17through240.95920.94450.95510.95620.95940.94610.94690.9239Columns25through310.91400.90770.92430.92680.93120.94460.9618range=0.87490.9741x1=1.0e+003*Columns1through80.
4、03130.06340.09670.13220.17270.21620.26410.3155Columns9through160.37110.43130.49610.56470.63800.71820.80590.8999Columns17through240.99901.10241.21191.32651.44631.57121.70331.8427Columns25through321.99362.15882.34072.53752.74992.97803.21943.4705u=-0.066531.3737y=-472.117+503.377*exp(.664533e-1*t)yu
5、ce=Columns1through831.260034.587636.964139.504042.218345.119248.219451.5326Columns9through1655.073458.857662.901767.223871.842876.779282.054887.6928Columns17through2493.7183100.1578107.0397114.3945122.2547130.6550139.6324149.2267Columns25through32159.4802170.4382182.1492194.6649208.0405222.335223
6、7.6121253.9386epsilon=Columns1through80-2.4976-3.5741-4.0540-1.6983-1.5992-0.3594-0.0826Columns9through160.52661.28241.91831.42621.37723.44085.63526.2772Columns17through245.44173.22222.42030.2055-2.4047-5.7350-7.5924-9.7767Columns25through32-8.5502-5.3082-0.21922.16514.33955.73483.8379-2.9086delt
7、a=Columns1through800.07780.10700.11440.04190.03670.00750.0016Columns9through160.00950.02130.02960.02080.01880.04290.06430.0668Columns17through240.05490.03120.02210.00180.02010.04590.05750.0701Columns25through320.05670.
此文档下载收益归作者所有