【正文】
使用步驟: ( 1)導(dǎo)入數(shù)據(jù),并畫(huà)圖; ( 2)在 tool菜單中單擊 Basic Fitting對(duì)話(huà)框 例:用基本擬合界面擬合 load census plot(cdate,pop,39??梢宰约褐付▍?shù)值,為 0時(shí),生成一個(gè)分段線(xiàn)性多項(xiàng)式的擬合,為 1時(shí),生成一個(gè)分段三次多項(xiàng)式的擬合,它穿過(guò)所有的數(shù)據(jù)點(diǎn)。 x=(4*pi)*[0 1 rand(1,25)]。 非參數(shù)擬合的方法包括 ( 1)插值法 Interpoants ( 2)平滑樣條內(nèi)插法 Smoothing spline 內(nèi)插法: 在已知數(shù)據(jù)點(diǎn)之間估計(jì)數(shù)值的過(guò)程,包括 Linear 線(xiàn)性?xún)?nèi)差,在每一隊(duì)數(shù)據(jù)之間用不同的線(xiàn)性多項(xiàng)式擬合; Nearest neighbor 最近鄰內(nèi)插,內(nèi)差點(diǎn)在最相鄰的數(shù)據(jù)點(diǎn)之間; Cubic spline 三次樣條內(nèi)插,在每一隊(duì)數(shù)據(jù)之間用不同的三次多項(xiàng)式擬合; Shapepreserving 分段三次艾爾米特內(nèi)插 . 平滑樣條內(nèi)插法: 是對(duì)雜亂無(wú)章的數(shù)據(jù)進(jìn)行平滑處理,可以用平滑數(shù)據(jù)的方法來(lái)擬合,平滑的方法在數(shù)據(jù)的預(yù)處理中已經(jīng)介紹。 cftool(x,y)。state39。 RMSE The root mean squared error. A value closer to 0 indicates a better fit. 偏差平方的均值的算術(shù)平方根,越接近 0越好 官方的解釋?zhuān)? Results – Displays detailed results for the current fit including the fit type (model, spline, or interpolant), the fitted coefficients and 95% confidence 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. Rsquare The coefficient of multiple determination. 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 Rsquare The degree of freedom adjusted Rsquare. 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. 曲線(xiàn)擬合好壞如何評(píng)價(jià) 首要指標(biāo)是目標(biāo)函數(shù)最?。〝M合度最大); 其次是應(yīng)考慮關(guān)鍵點(diǎn)的吻合,這些關(guān)鍵點(diǎn)包括:初始點(diǎn)(有時(shí)是原點(diǎn))、拐點(diǎn)、峰值點(diǎn)、極值點(diǎn)、中間點(diǎn)、漸近點(diǎn)、終值點(diǎn)等,在這些關(guān)鍵點(diǎn)上,數(shù)據(jù)觀(guān)察值點(diǎn)與函數(shù)值點(diǎn)應(yīng)盡可能一致; 再次是擬合的模型應(yīng)盡可能簡(jiǎn)單(模型的形式簡(jiǎn)單,參數(shù)數(shù)少)。 Type of fit 擬合的類(lèi)型,包括參數(shù)擬合和非參數(shù)擬合兩種。單擊 New fit 按鈕時(shí)系統(tǒng)會(huì)產(chǎn)生默認(rèn)的文件名。 ( 2) Table of Fits 同時(shí)列出所有的擬合結(jié)果。) 16 18 20 22 24 26 28 301820222426283032數(shù)據(jù)擬合函數(shù)表 cfit 產(chǎn)生擬合的目標(biāo) fit 用庫(kù)模型、自定義模型、平滑樣條或內(nèi)插方法來(lái)擬合數(shù)據(jù) fitoptions 產(chǎn)生或修改擬合選項(xiàng) fittype 產(chǎn)生目標(biāo)的擬合形式 cflibhelp 顯示一些信息,包括庫(kù)模型、三次樣條和內(nèi)插方法等。 y1=*x1.^2+*x1。r+39。) polyval(a,60) ans = 20 30 40 50 60 70 80 90 1 0 07 5 08 0 08 5 09 0 09 5 01 0 0 01 0 5 0例:已知年齡和運(yùn)動(dòng)能力的一組數(shù)據(jù),試確定二者的關(guān)系 (根據(jù)圖形指定次數(shù) ) 年齡 17 19 21 23 25 27 29 第一人 第二人 x1=[17:2:29]。,T,y,39。 y=poly2str(a,39。t39。go39。 y=[10 5 4 2 1 1 2 3 4]。 delta區(qū) 間內(nèi)的概率至少為 50%。 .y=polyval(p,x,[],mu) 用 x=(xu1)/u2代替 x,其中 mu是一個(gè) 二維向量 [u1,u2], u1=mean(x),u2=std(x),通過(guò)這 樣處理數(shù)據(jù),使數(shù)據(jù)合理化。 ( 2)用圖形窗口進(jìn)行操作,具有簡(jiǎn)便、快速,可操作性強(qiáng)的優(yōu)點(diǎn)。變量的轉(zhuǎn)換一般在命令 行里實(shí)現(xiàn),然后把轉(zhuǎn)換后的數(shù)據(jù)輸入曲線(xiàn)擬 合工具箱,進(jìn)行擬合。 Check to exclude point 挑選個(gè)別的點(diǎn)進(jìn)行排除,可以通過(guò)在數(shù)據(jù)表中打勾來(lái)選擇要排除的數(shù)據(jù)。 ( 2)排除法和區(qū)間排除法 排除法是對(duì)數(shù)據(jù)中的異常值進(jìn)行排除。 .View按鈕 打開(kāi)查看數(shù)據(jù)集的 GUI,以散點(diǎn)圖方式和工作表方式查看數(shù)據(jù),可以選擇排