Matlab的曲线拟合工具箱CFtool使用

上传人:鲁** 文档编号:486431217 上传时间:2023-09-01 格式:DOCX 页数:2 大小:9.99KB
返回 下载 相关 举报
Matlab的曲线拟合工具箱CFtool使用_第1页
第1页 / 共2页
Matlab的曲线拟合工具箱CFtool使用_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《Matlab的曲线拟合工具箱CFtool使用》由会员分享,可在线阅读,更多相关《Matlab的曲线拟合工具箱CFtool使用(2页珍藏版)》请在金锄头文库上搜索。

1、Matlab的曲线拟合工具箱CFtool使用it 2010-04-06 11:24:00阅读98评论0 字号:大中小订阅下面结合我使用的Matlab R2007b来简单介绍如何使用这个工具箱。假设我们要拟合的函数形式是y=A*x*x + B*x,且A0,B0。1、在命令行输入数据:x=110.3323 148.7328 178.064 202.8258033 224.7105 244.5711 262.908 280.0447296.204 311.5475y=5 10 15 20 25 30 35 40 45 50后点击“Create data set”按钮,退出“Data”窗口,返回工具箱

2、界面,这时会自动画出数选择数据集,然后通过下拉菜单Type of fit”选择拟合曲线的类型,工具箱提供的拟合类型有:Custom Equations:用户自定义的函数类型Exponential:指数逼近,有 2 种类型,a*exp(b*x)、a*exp(b*x) + c*exp(d*x)Fourier:傅立叶逼近,有7种类型,基础型是a0 + a1*cos(x*w) + b1*sin(x*w)Gaussian :高斯逼近,有8种类型,基础型是a1*exp(-(x-b1)/c1)A2)Interpolant: 插值逼近,有 4 种类型,linear、nearest neighbor、cubic

3、 spline、shapepreservingPolynomial:多形式逼近,有 9 种类型,linear 、quadratic 、cubic 、4-9th degree Power:幕逼近,有 2 种类型,a*xAb、a*xAb + cRational:有理数逼近,分子、分母共有的类型是linear 、quadratic 、cubic 、4-5thdegree ;此外,分子还包括constant型Smoothing Spline:平滑逼近(翻译的不大恰当,不好意思)Sum of Sin Functions:正弦曲线逼近,有8种类型,基础型是a1*sin(b1*x + c1)Weibull:

4、 只有一种,a*b*xA(b-1)*exp(-a*xAb)Equations线性等式”和“General Equations构造等式”两种标签。在本例中选Custom Equations,点击“New”按钮,选择“General Equations”标签,输入函数类型y=a*x*x + b*x,设置参数a、b的上下限,然后点击OK。(5)类型设置完成后,点击“Apply”按钮,就可以在Results框中得到拟合结果,如下例:Coefficients (with 95% confidence bounds):a = 0.009194 (0.009019, 0.00937)b = 1.78e-01

5、1 (fixed at bound)Goodness of fit:SSE: 6.146R-square: 0.997Adjusted R-square: 0.997RMSE: 0.8263同时,也会在工具箱窗口中显示拟合曲线。这样,就完成一次曲线拟合啦,十分方便快捷。当然,如果你觉得拟合效果不好,还可以在“Fitting”窗口点击“New fit”按钮,按照步骤(4)(5)进行一次新的拟合。不过,需要注意的是,cftool工具箱只能进行单个变量的曲线拟合,即待拟合的公式中,变量只能有一个。对于混合型的曲线,例如y = a*x + b/x,工具箱的拟合效果并不好。下一篇文章我介绍帮同学做的一个

6、非线性函数的曲线拟合。以上内容出自:http:/ 如何选取一种最优化的拟合方式是非常重要的,我们在采用CFTOOL拟合后,会有一些性能说明,如:Goodness of fit:SSE: 6.146R-square: 0.997Adjusted R-square: 0.997RMSE: 0.8263官方的解释:Results - Displays detailed results for the current fit including the fit type (model, spline, or interpolant), the fitted coefficients and 95% c

7、onfidence bounds for parametric fits, and these goodness of fit statistics:SSE - The sum of squares due to error. This statistic measures the deviation of the responses from the fitted values of the responses. A value closer to 0 indicates a better fit.R-square - The coefficient of multiple determin

8、ation. This statistic measures how successful the fit is in explaining the variation of the data. A value closer to 1 indicates a better fit.Adjusted R-square - The degree of freedom adjusted R-square. A value closer to 1 indicates a better fit. It is generally the best indicator of the fit quality when you add additional coefficients to your model.RMSE - The root mean squared error. A value closer to 0 indicates a better fit.

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号