【正文】
can be used to fit equations to your data.In order to use LSQNONLIN to do a weighted least square fit, you will need to have an equation into which you want to fit your data. For an example on weighted least squares fitting using LSQNONLIN, see the Related Solution listed below. 。, 39。, 39。,39。, 39。, 39。, 39。 39。 can be any of 39。 and tuning constant TUNE. 39。) uses the weighting function 39。,TUNE,39。*diag(w)*(b A*x). w typically contains either counts or inverse variances. In addition, there are three toolboxes you can use to implement weights for your fits:==================1. Statistics Toolbox:==================Weighted linear regression in the Statistics Toolbox is part of the ROBUSTFIT function,B = ROBUSTFIT(X,Y,39。權(quán)函數(shù) ?(x)必須 滿足:非負(fù)、可積,且在 [a, b]的任何子區(qū)間上?(x) ? 0。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)的重要程度。o39。 % Range for plotting yy = polyval(coef, xx)。 % Linear relationshipcoef = polyfit(xdata, ydata, degree)。ydata = [ ]。 為待定系數(shù);23矛盾方程組矛盾方程組試求下列矛盾方程組的解:很顯然,直接求解是不行的,因?yàn)闈M足方程組的精確解是不存在的!只能求出盡量滿足方程組的近似解。特別重要的是有些非線性最小二乘擬合問(wèn)題通過(guò)適當(dāng)?shù)淖儞Q可以轉(zhuǎn)化為線性最小二乘問(wèn)題求解。求適合上述關(guān)系的近似公式。因此而得所求擬合曲線為