作业帮 > 综合 > 作业

matlab非线性拟合求参数问题,

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/05/07 13:36:18
matlab非线性拟合求参数问题,
已知,
t=[0,1,2,3,4,5,6,7,8,9];
y=[127627,128453,129227,129988,130756,131448,132129,132802,133474,133972];
y=a(1)/(1+(a(1)/a(2)-1)*exp(-1*a(3)*t));
求参数a(1),a(2),a(3).
麻烦给出详细解答代码,
matlab非线性拟合求参数问题,
t=[0,1,2,3,4,5,6,7,8,9]';
y=[127627,128453,129227,129988,130756,131448,132129,132802,133474,133972]';
ft_ = fittype('a1/(1+(a1/a2-1)*exp(-1*a3*t))',...
'dependent',{'y'},'independent',{'t'},...
'coefficients',{'a1','a2','a3'});
st=[8000 150000 0.2]
[curve,goodness]= fit(t,y,ft_,'Startpoint',st)
figure
plot(curve,'predobs',0.95);
hold on,plot(t,y,'b*')
st =
1.0e+005 *
0.0800 1.5000 0.0000
curve =
General model:
curve(t) = a1/(1+(a1/a2-1)*exp(-1*a3*t))
Coefficients (with 95% confidence bounds):
a1 = 1.468e+005 (1.437e+005,1.499e+005)
a2 = 1.276e+005 (1.276e+005,1.277e+005)
a3 = 0.05059 (0.04164,0.05954)
goodness =
sse:6.6191e+003
rsquare:0.9998
dfe:7
adjrsquare:0.9998
rmse:30.7503
再问: 恩,非常感谢。上面运行出来的图形中,data3和data4分别表示的是什么呀? 如果需要再预测 t=5到14这10年内的数值怎么做呢?利用上面的结果。 M=146819; X=127680; R=0.05059; X(t)=M/(1+(M/X-1)*exp(-1*R.*t))
再答: data3 虚线表示的是95%置信区间上界和下界 data4 *号原数据 t=5:14; M=146819; X=127680; R=0.05059; Xt=M./(1+(M/X-1)*exp(-1*R*t)) Xt = 1.0e+005 * Columns 1 through 5 1.3151 1.3219 1.3284 1.3347 1.3407 Columns 6 through 10