找回密码
 注册
Simdroid-非首页
查看: 63|回复: 0

关于拟合fittype的问题,请教高手!

[复制链接]
发表于 2011-4-19 20:33:50 | 显示全部楼层 |阅读模式 来自 四川成都
本帖最后由 南边的北边 于 2011-4-19 20:36 编辑

有两组数据:
  1. x=[5:30];
  2. 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一样的指数函数,下面是结果。

  1. >> f=fittype('a*exp(b*x)+c*exp(d*x)','coeff',{'a','b','c','d'});
  2. >> [c,gof2]=fit(x',y',f)
  3. Warning: Start point not provided, choosing random start point.
  4. > In fit>handlewarn at 705
  5. In fit at 321
  6. c =
  7. General model:
  8. c(x) = a*exp(b*x)+c*exp(d*x)
  9. Coefficients (with 95% confidence bounds):
  10. a = 0.00362 (-0.02079, 0.02803)
  11. b = 0.1983 (-0.107, 0.5036)
  12. c = -3.244e-010 (-1.577e-008, 1.512e-008)
  13. d = 0.7468 (-0.7801, 2.274)

  14. gof2 =
  15. sse: 1.7698
  16. rsquare: -282.6509
  17. dfe: 22
  18. adjrsquare: -321.3306
  19. rmse: 0.2836
复制代码
另外附上cftool的结果:

  1. General model Exp2:
  2.      f(x) = a*exp(b*x) + c*exp(d*x)
  3. Coefficients (with 95% confidence bounds):
  4.        a =      0.1916  (0.1792, 0.204)
  5.        b =      -0.319  (-0.3373, -0.3006)
  6.        c =     0.04072  (0.03814, 0.04329)
  7.        d =    -0.04487  (-0.0476, -0.04214)
  8. Goodness of fit:
  9.   SSE: 1.669e-006
  10.   R-square: 0.9997
  11.   Adjusted R-square: 0.9997
  12.   RMSE: 0.0002754
复制代码
两者的差别比较大,感觉问题应该是warning的问题吧,请教高手如何处理warning中的关于处置的设置呢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-10-4 21:22 , Processed in 0.027246 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表