- 积分
- 0
- 注册时间
- 2011-4-19
- 仿真币
-
- 最后登录
- 1970-1-1
|
本帖最后由 南边的北边 于 2011-4-19 20:36 编辑
有两组数据:- x=[5:30];
- y=[0.07187 0.05888 0.04987 0.04324 0.03815 0.03417 0.03093 0.02824 0.02598 0.02406 0.02241 0.02096 0.0197 0.01857 0.01757 0.01667 0.01585 0.01511 0.01444 0.01383 0.01326 0.01275 0.01226 0.01182 0.0114 0.01101];
复制代码 想要对其进行拟合,采用指数拟合。
尝试两种命令操作:
1.自己定义指数函数,但采用的是cftool一样的指数函数,下面是结果。-
- >> f=fittype('a*exp(b*x)+c*exp(d*x)','coeff',{'a','b','c','d'});
- >> [c,gof2]=fit(x',y',f)
- Warning: Start point not provided, choosing random start point.
- > In fit>handlewarn at 705
- In fit at 321
- c =
- General model:
- c(x) = a*exp(b*x)+c*exp(d*x)
- Coefficients (with 95% confidence bounds):
- a = 0.00362 (-0.02079, 0.02803)
- b = 0.1983 (-0.107, 0.5036)
- c = -3.244e-010 (-1.577e-008, 1.512e-008)
- d = 0.7468 (-0.7801, 2.274)
- gof2 =
- sse: 1.7698
- rsquare: -282.6509
- dfe: 22
- adjrsquare: -321.3306
- rmse: 0.2836
复制代码 另外附上cftool的结果:-
- General model Exp2:
- f(x) = a*exp(b*x) + c*exp(d*x)
- Coefficients (with 95% confidence bounds):
- a = 0.1916 (0.1792, 0.204)
- b = -0.319 (-0.3373, -0.3006)
- c = 0.04072 (0.03814, 0.04329)
- d = -0.04487 (-0.0476, -0.04214)
- Goodness of fit:
- SSE: 1.669e-006
- R-square: 0.9997
- Adjusted R-square: 0.9997
- RMSE: 0.0002754
复制代码 两者的差别比较大,感觉问题应该是warning的问题吧,请教高手如何处理warning中的关于处置的设置呢! |
|