您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > logistic模型及其matlab算法
LogisticQQ2377389590Logistic18441845PierreFran?oisVerhulstlogisticSlogistic1etbtxca(1)t,abc0a0,0bc10ln(c/a)/b01/(2c)1/c(ln(c/a)/b,1/(2c))1(1)t()0xtt()1/xtcLogistic(1)20()btbtdxabedtcae1logisticxtt=1,2,,nlogistic1.1.Yule(1)111(1)=11()(1)(1)(1)tttttbtbtbtbbtbbtxxxxxcaecaeaeccecaeecex(2)11ttttxxzx1be(1)bce(2)ttzxOLSbca(1)1???lnlntcabtxt=1.2.,n(3)t11(1)???lnln2nttnncnabx(4)a111(1)???expln2nttnnacbnx(5)1.2.Rhodes1(1)1(1)1(1)bttbbbtbbtcaexcceceaeecex(6)11ttzx1ttsx(1)bcebe6ttzsOLSbc3-5a1.3.Nair211(1)(1)bttttxxecxx(7)11(1)11ttbttxcxexx(8)1111111121112(1)1211211bbbtttttttttttttteeexcxxxxcxxxxxcxxxx(9)911111112(1)11bbbbttttecexxexxe(10)111tttzxx111tttsxx2(1)1bbcere11bbee10ttzsOLSbc3-5a2.1965-2011CO2111965-2011CO21965196619671968196919701971197219731974480.9522.0468.8469.5573.8737.8869.8933.7977.2997.719751976197719781979198019811982198319841120.31176.11284.81422.11462.11499.71473.11539.21637.01771.019851986198719881989199019911992199319941886.51994.62145.72292.02396.82387.02484.42580.82750.22915.719951996199719981999200020012002200320043163.83231.93319.53319.63484.03550.63613.93833.14471.25283.020052006200720082009201020115803.26415.56797.97033.57636.38209.88979.1logisticCO2MAPECO22.1.Yuleclear;clc;%Yule%author:%date:2018-1-24X=[480.9,522,468.8,469.5,573.8,737.8,869.8,933.7,977.2,...997.7,1120.3,1176.1,1284.8,1422.1,1462.1,1499.7,...1473.1,1539.2,1637,1771,1886.5,1994.6,2145.7,2292,...2396.8,2387,2484.4,2580.8,2750.2,2915.7,3163.8,3231.9,...3319.5,3319.6,3484.,3550.6,3613.9,3833.1,4471.2,5283,...5803.2,6415.5,6797.9,7033.5,7636.3,8209.8,8979.1]n=length(X)-1fort=1:nZ(t)=(X(t+1)-X(t))/X(t+1)endX1=[ones(46,1)X(1:n)']Y=Z'[B,Bint,r,rint,stats]=regress(Y,X1)%OLSgamma=B(1,1)beta=B(2,1)b=log(1-gamma)c=beta/(exp(b)-1)a=exp((sum(log(1./X(1:n)-c))-n*(n+1)*b/2)/n)XX=1965:2016YY=1./(c+a*exp(b*([XX-1965])))plot(XX,YY,'r-o')holdonplot(XX(1:length(X)),X,'g-^')legend('','')xlabel('');ylabel('CO_{2}');title('CO_{2}(Yule)')set(gca,'XTick',[1965:2:2017])gridonformatshort;forecast=YY(end-4:end)%CO2MAPE=sum(abs(YY(1:n+1)-X)./X)/length(X)%a,b,c2.2.Rhodesclear;clc;%Rhodes%author:%date:2018-1-24X=[480.9,522,468.8,469.5,573.8,737.8,869.8,933.7,977.2,...997.7,1120.3,1176.1,1284.8,1422.1,1462.1,1499.7,...1473.1,1539.2,1637,1771,1886.5,1994.6,2145.7,2292,...2396.8,2387,2484.4,2580.8,2750.2,2915.7,3163.8,3231.9,...3319.5,3319.6,3484.,3550.6,3613.9,3833.1,4471.2,5283,...5803.2,6415.5,6797.9,7033.5,7636.3,8209.8,8979.1]n=length(X)-1fort=1:nZ(t)=1/X(t+1)S(t)=1/X(t)endX1=[ones(46,1)S(1:n)']Y=Z'[B,Bint,r,rint,stats]=regress(Y,X1)%OLSgamma=B(1,1)beta=B(2,1)b=log(beta)c=gamma/(1-exp(b))a=exp((sum(log(1./X(1:n+1)-c))-(n+1)*(n+2)*b/2)/(n+1))XX=1965:2016YY=1./(c+a*exp(b*([XX-1965])))plot(XX,YY,'r-o')holdonplot(XX(1:length(X)),X,'k-^')set(gca,'XTick',[1965:2:2017])legend('','')xlabel('');ylabel('CO_{2}');title('CO_{2}(Rhodes)')gridonformatshort;forecast=YY(end-4:end)%CO2MAPE=sum(abs(YY(1:n+1)-X)./X)/length(X)%a,b,c2.3.Nairclear;clc;%Nair%author:%date:2018-1-24X=[480.9,522,468.8,469.5,573.8,737.8,869.8,933.7,977.2,...997.7,1120.3,1176.1,1284.8,1422.1,1462.1,1499.7,...1473.1,1539.2,1637,1771,1886.5,1994.6,2145.7,2292,...2396.8,2387,2484.4,2580.8,2750.2,2915.7,3163.8,3231.9,...3319.5,3319.6,3484.,3550.6,3613.9,3833.1,4471.2,5283,...5803.2,6415.5,6797.9,7033.5,7636.3,8209.8,8979.1]n=length(X)-1fort=1:nZ(t)=1/X(t)-1/X(t+1)S(t)=1/X(t)+1/X(t+1)endX1=[ones(46,1)S(1:n)']Y=Z'[B,Bint,r,rint,stats]=regress(Y,X1)%OLSgamma=B(1,1)beta=B(2,1)b=log((1-beta)/(1+beta))c=gamma*(1+exp(b))/(2*(exp(b)-1))a=exp((sum(log(1./X(1:n)-c))-n*(n+1)*b/2)/n)XX=1965:2016YY=1./(c+a*exp(b*([XX-1965])))plot(XX,YY,'r-o')holdonplot(XX(1:length(X)),X,'g-^')legend('','')xlabel('');ylabel('');title('(Nair)')set(gca,'XTick',[1965:2:2017])gridonformatshort;forecast=YY(end-4:end)%CO2MAPE=sum(abs(YY(1:n+1)-X)./X)/length(X)%a,b,cMAPE11abcMAPEYule0.0020-0.0580-0.0000245790.1141Rhodes0.0019-0.08020.000109600.1259Nair0.0023-0.06830.0000165640.1271CO222CO220122013201420152016Yule91679847105871139612282Rhodes6476.76624.96767.86905.37037.3Nair90509588101521074211359
本文标题:logistic模型及其matlab算法
链接地址:https://www.777doc.com/doc-8704829 .html