MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB数学相关] polyfit结果是什么意思 (https://www.labfans.com/bbs/showthread.php?t=13356)

yanzhaolun 2011-05-09 15:52

polyfit结果是什么意思
 
我用polufit算出结果中有df:和nor
不知道它们怎么用

yhcode 2011-05-09 16:01

回复: polyfit结果是什么意思
 
Matlab Help中对polyfit的说明很详细:
p = polyfit(x,y,n) finds the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i)) to y(i), in a least squares sense. The result p is a row vector of length n+1 containing the polynomial coefficients in descending powers

[p,S] = polyfit(x,y,n) returns the polynomial coefficients p and a structure S for use with polyval to obtain error estimates or predictions. Structure S contains fields R, df, and normr, for the triangular factor from a QR decomposition of the Vandermonde matrix of X, the degrees of freedom, and the norm of the residuals, respectively. If the data Y are random, an estimate of the covariance matrix of P is (Rinv*Rinv')*normr^2/df, where Rinv is the inverse of R. If the errors in the data y are independent normal with constant variance, polyval produces error bounds that contain at least 50% of the predictions.

[p,S,mu] = polyfit(x,y,n) finds the coefficients of a polynomial in

where and . mu is the two-element vector . This centering and scaling transformation improves the numerical properties of both the polynomial and the fitting algorithm.
你所说的df和nor我不清楚是什么,实际上这个函数的目的就是用多项式模型对实际数据(x,y)进行拟合,拟合的结果是多项式各项的系数,当然还可给出拟合后数据的方差和期望等信息


所有时间均为北京时间。现在的时间是 11:27

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.