matlab指数增长模型的系数,matlab指数增长和阻滞增长拟合代码.doc

41528d3028836879cd698677c3999917.gifmatlab指数增长和阻滞增长拟合代码.doc

02468101214050010001500万万万万万万万万万万万万万万万万万万万万万万万万万万万万万万024681012140100200300400万万万万万万万万万万万万万万万万万万万万万万万万万万万万万万024681012140100200300万万万万万万万万万万万万万万万万万万万万万万万万万万万万万万024681012140100200300万万万万万万万万万万万万万万万万万万万万万万万万万万万万万代码:t=1:13;x=[3.04,6.63,11.13,28.43,49.22,87.85,134.11,200.00,208.69,303.03,410.73,580.00,728.57];c=[0.40,0.97,2.31,4.45,7.63,10.11,19.86,33.44,38.03,75.07,112.08,152.39,226.55];d=[2.06,2.35,3.17,8.06,15.22,28.82,43.31,54.67,55.83,75.26,102.01,174.05,200.95];e=[0.54,1.18,1.98,5.06,8.77,15.65,23.89,36.63,37.17,53.98,73.16,123.31,159.78];%指数增长模型y=log(x);cc=log(c);dd=log(d);ee=log(e);a=polyfit(t,y,1);h=polyfit(t,cc,1);i=polyfit(t,dd,1);k=polyfit(t,ee,1);r=a(1);r2=h(1);r3=i(1);r4=k(1);x0=exp(a(2));x1=x0*exp(r*t);c0=exp(h(2));c1=c0*exp(r2*t);d0=exp(i(2));d1=d0*exp(r3*t);e0=exp(k(2));e1=e0*exp(r4*t);%阻滞增长模型f=@(a,t)a(1)./(1+(a(1)/x(1)-1)*exp(-a(2)*(t-t(1))));f=@(h,t)h(1)./(1+(h(1)/c(1)-1)*exp(-h(2)*(t-t(1))));f=@(i,t)i(1)./(1+(i(1)/d(1)-1)*exp(-i(2)*(t-t(1))));f=@(k,t)k(1)./(1+(k(1)/e(1)-1)*exp(-k(2)*(t-t(1))));a=lsqcurvefit(f,[8001],t,x);h=lsqcurvefit(f,[8001],t,c);i=lsqcurvefit(f,[8001],t,d);k=lsqcurvefit(f,[8001],t,e);figure(1);subplot(2,1,1);plot(t,x, o ,t,x1, r:. );x2=f(a,t);plot(t,x, o ,t,x1, r:. ,t,x2, g*-- )legend( 原始数据 , 指数增长模型 , 阻滞增长模型 ,2)xlabel时间段ylabel公众号总量(万)title( 资讯类 );figure(1)subplot(2,1,2);plot(t,c, o ,t,c1, r:. );c2=f(h,t);plot(t,c, o ,t,c1, r:. ,t,c2, g*-- )legend( 原始数据 , 指数增长模型 , 阻滞增长模型 ,2)xlabel时间段ylabel公众号总量(万)title( 生活类 );figure(2)subplot(2,1,1);plot(t,d, o ,t,d1, r:. );d2=f(i,t);plot(t,d, o ,t,d1, r:. ,t,d2, g*-- )legend( 原始数据 , 指数增长模型 , 阻滞增长模型 ,2)xlabel时间段ylabel公众号总量(万)title( 娱乐类 );figure(2)subplot(2,1,2);plot(t,e, o ,t,e1, r:. );e2=f(k,t);plot(t,e, o ,t,e1, r:. ,t,e2, g*-- )legend( 原始数据 , 指数增长模型 , 阻滞增长模型 ,2)xlabel时间段ylabel公众号总量(万)title( 其他 );)1(xkebar参数资讯类生活类娱乐类其他类公众号总量a1.584.36561049.2254b247671.0158k.03.07.8.05101520250100200300400500600700800 xe万万万万万万万万万万万万万万万万万万万万万万万万万万万程序代码:x=[1:2:26] ;y=[3.04,6.63,11.13,28.43,49.22,87.85,134.11,200.00,208.69,303.03,410.73,580.00,728.57] ;b=[2.04,2.14,3.68,10.86,17.60,33.27,47.05,75.26,77.66,88.72,123.48,130.25,141.29] ;c=[0.40,0.97,2.31,4.45,7.63,10.11,19.86,33.44,38.03,75.07,112.08,152.39,226.55] ;d=[2.06,2.35,3.17,8.06,15.22,28.82,43.31,54.67,55.83,75.26,102.01,174.05,200.95] ;e=[0.54,1.18,1.98,5.06,8.77,15.65,23.89,36.63,37.17,53.98,73.16,123.31,159.78] ;st_=[500300.2];ft_=fittype( a0/(1+b0*exp(-k0*(x-1))) ,. dependent ,{ y }, independent ,{ x },. coefficients ,{ a0 , b0 , k0 });cf_=fit(x,y,ft_, Startpoint ,st_)plot(cf_, fit ,0.95);holdon,plot(x,y, ro )f1t_=fittype( a1/(1+b1*exp(-k1*(x-1))) ,. dependent ,{ b }, independent ,{ x },. coefficients ,{ a1 , b1 , k1 });c1f_=fit(x,b,f1t_, Startpoint ,st_)plot(c1f_, fit ,0.95);holdon,plot(x,b, g* )f2t_=fittype( a2/(1+b2*exp(-k2*(x-1))) ,. dependent ,{ c }, independent ,{ x },. coefficients ,{ a2 , b2 , k2 });c2f_=fit(x,c,f2t_, Startpoint ,st_)plot(c2f_, fit ,0.95);holdon,plot(x,c, b+ )f3t_=fittype(

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值