主题: [MATLAB数学相关] polyfit结果是什么意思
查看单个帖子
旧 2011-05-09, 16:01   #2
yhcode
高级会员
 
注册日期: 2008-05-13
年龄: 44
帖子: 232
声望力: 21
yhcode 正向着好的方向发展
默认 回复: 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)进行拟合,拟合的结果是多项式各项的系数,当然还可给出拟合后数据的方差和期望等信息
__________________
工科'985'博士,(图像处理、分析及理解;模式识别;运动估计;数据分析等)定做程序、算法实现--qq:752105755
yhcode 当前离线   回复时引用此帖