hyjzy
2007-07-18, 10:01
一组植物生长数据拟合!我用logistic曲线N=a/(1+b*exp(-r*t))拟合,用了nlinfit或lsqcurvefit进行拟合。能拟合出来,但与我希望的有差距。我希望拟合出来是S型,但拟合结果确是弧线,没有出现一开始的缓慢生长期,这与植物实际生长情况不符。请问大侠有无办法能人为按我的思路进行拟合呢?
我的程序如下:
load growthdata.txt
all_para=[];
t=1:9;
z=[];
y0=[38.8 47.7 50.9 53.4 65.4 69.5 78.2 83.3 83.3];
beta0=[50 5 1];
lb=[0 0 0];
ub=[83.3*1.05 1000000 1];
beta=lsqcurvefit('growth0',beta0,t,y0,lb,ub);%,lb,ub
for j=1:9
y=logis0(beta(1),beta(2),beta(3),j);
z=[z y];
end
all_para=[all_para; beta t1 t0 t2];
x=0.05; y=0.1; width=0.5;height=0.8;
subplot('Position',[x y width height]);
plot(t,y0,'*',t,z)
all_para
我的程序如下:
load growthdata.txt
all_para=[];
t=1:9;
z=[];
y0=[38.8 47.7 50.9 53.4 65.4 69.5 78.2 83.3 83.3];
beta0=[50 5 1];
lb=[0 0 0];
ub=[83.3*1.05 1000000 1];
beta=lsqcurvefit('growth0',beta0,t,y0,lb,ub);%,lb,ub
for j=1:9
y=logis0(beta(1),beta(2),beta(3),j);
z=[z y];
end
all_para=[all_para; beta t1 t0 t2];
x=0.05; y=0.1; width=0.5;height=0.8;
subplot('Position',[x y width height]);
plot(t,y0,'*',t,z)
all_para