永发信息网

怎么对如下的数据进行最小二乘拟合

答案:2  悬赏:50  手机版
解决时间 2021-02-08 02:28
0.62 525.75
0.62 525.78
0.62 525.81
0.62 525.88
0.62 525.94
0.62 526.00
0.62 526.06
0.62 526.19
0.62 526.25
0.62 526.28
0.54 526.31
0.54 526.38
0.54 526.44
0.54 526.50
0.54 526.56
0.54 526.69
0.54 526.72
0.62 525.75
0.62 525.78
0.62 525.81
0.62 525.88
0.62 525.94
0.62 526.00
0.62 526.06
0.62 526.19
0.62 526.25
0.62 526.28
0.54 526.31
0.54 526.38
0.54 526.44
0.54 526.50
0.54 526.56
0.54 526.69
0.54 526.72
数据是这样的,那么怎么用最小方差无偏估计量,不用polyfit函数,进行最小二乘拟合呢?请高手指点啊
最佳答案
不用matlab里的polyfit函数,可以用spss 之类的软件

POLYFIT Fit polynomial to data.
P = POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of
degree N that fits the data Y best in a least-squares sense. P is a
row vector of length N+1 containing the polynomial coefficients in
descending powers, P(1)*X^N + P(2)*X^(N-1) +...+ P(N)*X + P(N+1).

[P,S] = POLYFIT(X,Y,N) returns the polynomial coefficients P and a
structure S for use with POLYVAL to obtain error estimates for
predictions. S contains fields for the triangular factor (R) from a QR
decomposition of the Vandermonde matrix of X, the degrees of freedom
(df), and the norm of the residuals (normr). 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.

[P,S,MU] = POLYFIT(X,Y,N) finds the coefficients of a polynomial in
XHAT = (X-MU(1))/MU(2) where MU(1) = MEAN(X) and MU(2) = STD(X). This
centering and scaling transformation improves the numerical properties
of both the polynomial and the fitting algorithm.

Warning messages result if N is >= length(X), if X has repeated, or
nearly repeated, points, or if X might need centering and scaling.

Class support for inputs X,Y:
float: double, single
全部回答
用polyfit()语句可以 polyfit(x,y,拟合次数n); x,y是你的数据,n是你要进行几次拟合,填1的话为一次也就是最小二乘法拟合 你可以这样写 x=[ 0.25 0.5 0.75 1 1.5 2 2.5 3 3.5 4 4.5 5 6 7 8 9 10 11 12 13 14 15 16]; y=[30 68 75 82 82 77 68 68 58 51 50 41 38 35 28 25 18 15 12 10 7 7 4]; p=polyfit(x,y,1); plot(x,y,'b',x,polyval(p,x),'r'); %如果作图的话,蓝线为原数据,红线为拟合数据 不知道对你有没有帮助
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
小学二年级下册课文 <风姑姑的照片>的课文内
和好面团不想让它发酵怎么放在
吉林查干湖国家级自然保护区博物馆地址有知道
【z223】电气设计图 上面的 AP86Z223-16
柒加壹电脑手机城地址在哪,我要去那里办事
动力鸡车(小坝店)在什么地方啊,我要过去处理
为什么笔记本关机后电源接口处一直闪黄光
群星电脑维修中心地址在哪,我要去那里办事
驾驶证在雅安扣了24分是成都的驾照可以在雅安
剑门蜂月启蕊蜂业我想知道这个在什么地方
狗狗怎么看它是不是完全生产完了 生了两个 过
用力拍了笔记本键盘右下角一下,就开始发出噪
创新科技手机快修地址好找么,我有些事要过去
与字加两笔变什么字
爱心食杂店地址在什么地方,想过去办事
推荐资讯
翡翠雕刻中有那些雕工啊?我就知道什么福建工
陶渊明“独爱菊”和世人“甚爱牡丹”有什么作
四川康贝大药房青白江区怡宁堂药店地址在什么
鸿鹄旅行社地址在什么地方,我要处理点事
三星智力快车》2003年年冠军总决赛
如皋市搬经夏堡幼儿园我想知道这个在什么地方
淮安市公安局交通巡逻警察支队二大队园区中队
阳光学生托管(北兰江路)地址有知道的么?有点
汀雪辰美容美发用品旗舰店这个地址在什么地方
如图是人体眼球结构图,请认真看图并回答问题
上海市浦东新区小风车广洋新景幼儿园怎么去啊
家中放什么植物
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?