【正文】
use the outlier lies far away from the true pattern of data, it induces error to the true fit. A workaround to this problem would be to minimize the weight(s) of such outlier(s). Solution:In MATLAB, the LSCOV function can perform weightedleastsquare regression. x = lscov(A,b,w)where w is a vector length m of real positive weights, returns the weighted least squares solution to the linear system A*x = b, that is, x minimizes (b A*x)39。WFUN39。fair39。welsch39。logistic39。bisquare39。CONST39。, xx, yy)。24矛盾方程組矛盾方程組運(yùn)用最小二乘法,要求滿足方程組的解,即求使下列值 最小的解 ,就是方程組的近似解:25矛盾方程組矛盾方程組得解:Matlab 實(shí)例實(shí)例xdata = [0 5 10 15 25]。? 解:根據(jù)所給數(shù)據(jù),在直角坐標(biāo)下畫出數(shù)據(jù)點(diǎn),從圖中可以看出,各點(diǎn)在一條直線附近,故可取線性函數(shù)作為擬合曲線 1 2 3 4 54 6 8 15擬合例題(續(xù)擬合例題(續(xù) 1))? 令 將數(shù)據(jù)帶入公式得,? 解得 。 因此,插值方法只能適用那些誤差可以忽略不記的情況,當(dāng)誤差較大而不能忽略時(shí),又如何通過這些觀測(cè)數(shù)據(jù)確定其內(nèi)在的變化規(guī)律呢?曲線擬合就是解決這一問題的主要方法之一。 5曲線擬合的概念曲線擬合的概念如圖所示,常常需要從一組獲得的數(shù)據(jù)點(diǎn)中,尋找變量與變量之間的變化規(guī)律.用幾何方法來解釋,就是用已知平面內(nèi)的一組點(diǎn),來確定一條曲線, 使該曲線能在整體上刻畫這組點(diǎn)的變化趨勢(shì)而不需通過每個(gè)點(diǎn), 我們稱這種方法為曲線擬合,所求出的曲線稱為擬合曲線。因此而得所求擬合曲線為 。ydata = [ ]。26加權(quán)最小二乘法加權(quán)最小二乘法27定義 權(quán)函數(shù):① 離散型 /*discrete type */根據(jù)一系列離散點(diǎn) 擬合時(shí),在每一誤差前乘一正數(shù) wi ,即 誤差函數(shù) ? ,這個(gè) wi 就稱作權(quán) /* weight*/,反映該點(diǎn)的重要程度。)