请输入您要查询的字词:

 

单词 LinearLeastSquaresFit
释义

linear least squares fit


One of the most common uses of least squares fitting is fitting a straight line todata. Whilst, in general, it is difficult to determine the curve which best fitsthe data, in this case there is a relatively simple formula which can be used.

Theorem 1.

Suppose we have a data set (x1,y1),,(xn,yn). Then the straightline which best fits this set is given as

y=ns-pqnr-p2x+qr-psnr-p2

where

p=k=1nxk(1)
q=k=1nyk(2)
r=k=1nxk2(3)
s=k=1nxkyk(4)
Proof.

Being the best fitting line means minimizing the merit function M, given as

M(a,b)=k=0n(axk+b-yk)2

with respect to the parameters a and b. Expanding the square, this can bewritten as

M(a,b)=ra2+2pab+nb2-2sa-2qb+t

where p,q,r,s are as above and

t=k=1nyk2.

This function M is a quadratic polynomial; moreover, from its definition as asum of squares, it is clear that the highest order terms are positive definitePlanetmathPlanetmath,hence it has a minimum and all that remains is to find that minimum. To do this,we set the derivatives equal to zero to obtain the following equations:

0=M(a,b)a=2ar+2pb-2s(5)
0=M(a,b)b=2pa+2nb-2q(6)

These equations are easily solved to give

a=ns-pqnr-p2(7)
b=qr-psnr-p2;(8)

substituting in the equation y=ax+b for a straight line, we obtainthe answer given above.∎

Because of the ease with which one can make a least squares fit of a line, thistechnique is often adapted to fitting other sorts of curves by making a changeof variables. Two common cases of this practice are power laws and exponentials.

Suppose that one wants to fit some data to a curve of the form y=cekx.Making a change of variable y=eu and defining b=logc, the equation ofthe curve becomes u=kx+b. One can therefore fit the data set (x1,logy1),(xn,logyn) to a straight line.

Suppose that one wants to fit some data to a curve of the form y=cxp. Makinga change of variable x=ev, y=eu and defining b=logc, the equation ofthe curve becomes u=pv+b. One can therefore fit the data set (logx1,logy1),(logxn,logyn) to a straight line.

Although convenient and common, this procedure can be a cheat because changing variablesand making a least squares fit of a line is not the same as making a least squares fitto a curve. The reason for this is that the merit functions are different and will not,in general have a minimum in the same place. However, if the data happen to approximatelylie on a power curve or an exponential, then the answer obtained by changing variablesand fitting will be an approximation to the correct answer. Depending on what one isdoing, this approximation may be good enough or one may use it as a starting point forsome algorithm to compute the correct minimum.

随便看

 

数学辞典收录了18232条数学词条,基本涵盖了常用数学知识及数学英语单词词组的翻译及用法,是数学学习的有利工具。

 

Copyright © 2000-2023 Newdu.com.com All Rights Reserved
更新时间:2025/5/5 4:48:48