Least Squares Fitting (2024)

Least Squares Fitting (1) TOPICS

Least Squares Fitting (4)

Download WolframNotebook

Least Squares Fitting (7)

A mathematical procedure for finding the best-fitting curve to a given set of points by minimizing the sum of the squares of the offsets ("the residuals") of the points from the curve. The sum of the squares of the offsets is used instead of the offset absolute values because this allows the residuals to be treated as a continuous differentiable quantity. However, because squares of the offsets are used, outlying points can have a disproportionate effect on the fit, a property which may or may not be desirable depending on the problem at hand.

Least Squares Fitting (8)

In practice, the vertical offsets from a line (polynomial, surface, hyperplane, etc.) are almost always minimized instead of the perpendicular offsets. This provides a fitting function for the independent variable Least Squares Fitting (9) that estimates Least Squares Fitting (10) for a given Least Squares Fitting (11) (most often what an experimenter wants), allows uncertainties of the data points along the Least Squares Fitting (12)- and Least Squares Fitting (13)-axes to be incorporated simply, and also provides a much simpler analytic form for the fitting parameters than would be obtained using a fit based on perpendicular offsets. In addition, the fitting technique can be easily generalized from a best-fit line to a best-fit polynomial when sums of vertical distances are used. In any case, for a reasonable number of noisy data points, the difference between vertical and perpendicular fits is quite small.

The linear least squares fitting technique is the simplest and most commonly applied form of linear regression and provides a solution to the problem of finding the best fitting straight line through a set of points. In fact, if the functional relationship between the two quantities being graphed is known to within additive or multiplicative constants, it is common practice to transform the data in such a way that the resulting line is a straight line, say by plotting Least Squares Fitting (14) vs. Least Squares Fitting (15) instead of Least Squares Fitting (16) vs. Least Squares Fitting (17) in the case of analyzing the period Least Squares Fitting (18) of a pendulum as a function of its length Least Squares Fitting (19). For this reason, standard forms for exponential, logarithmic, and power laws are often explicitly computed. The formulas for linear least squares fitting were independently derived by Gauss and Legendre.

For nonlinear least squares fitting to a number of unknown parameters, linear least squares fitting may be applied iteratively to a linearized form of the function until convergence is achieved. However, it is often also possible to linearize a nonlinear function at the outset and still use linear methods for determining fit parameters without resorting to iterative procedures. This approach does commonly violate the implicit assumption that the distribution of errors is normal, but often still gives acceptable results using normal equations, a pseudoinverse, etc. Depending on the type of fit and initial parameters chosen, the nonlinear fit may have good or poor convergence properties. If uncertainties (in the most general case, error ellipses) are given for the points, points can be weighted differently in order to give the high-quality points more weight.

Vertical least squares fitting proceeds by finding the sum of the squares of the vertical deviations Least Squares Fitting (20) of a set of Least Squares Fitting (21) data points

Least Squares Fitting (22)

(1)

from a function Least Squares Fitting (23). Note that this procedure does not minimize the actual deviations from the line (which would be measured perpendicular to the given function). In addition, although the unsquared sum of distances might seem a more appropriate quantity to minimize, use of the absolute value results in discontinuous derivatives which cannot be treated analytically. The square deviations from each point are therefore summed, and the resulting residual is then minimized to find the best fit line. This procedure results in outlying points being given disproportionately large weighting.

The condition for Least Squares Fitting (24) to be a minimum is that

for Least Squares Fitting (26), ..., Least Squares Fitting (27). For a linear fit,

Least Squares Fitting (28)

(3)

so

Least Squares Fitting (29)

(4)

Least Squares Fitting (30)

(5)

Least Squares Fitting (31)

(6)

These lead to the equations

Least Squares Fitting (32)Least Squares Fitting (33)Least Squares Fitting (34)

(7)

Least Squares Fitting (35)Least Squares Fitting (36)Least Squares Fitting (37)

(8)

In matrix form,

Least Squares Fitting (38)

(9)

so

Least Squares Fitting (39)

(10)

The Least Squares Fitting (40) matrix inverse is

Least Squares Fitting (41)

(11)

so

Least Squares Fitting (42)Least Squares Fitting (43)Least Squares Fitting (44)

(12)

Least Squares Fitting (45)Least Squares Fitting (46)Least Squares Fitting (47)

(13)

Least Squares Fitting (48)Least Squares Fitting (49)Least Squares Fitting (50)

(14)

Least Squares Fitting (51)Least Squares Fitting (52)Least Squares Fitting (53)

(15)

(Kenney and Keeping 1962). These can be rewritten in a simpler form by defining the sums of squares

Least Squares Fitting (54)Least Squares Fitting (55)Least Squares Fitting (56)

(16)

Least Squares Fitting (57)Least Squares Fitting (58)Least Squares Fitting (59)

(17)

Least Squares Fitting (60)Least Squares Fitting (61)Least Squares Fitting (62)

(18)

Least Squares Fitting (63)Least Squares Fitting (64)Least Squares Fitting (65)

(19)

Least Squares Fitting (66)Least Squares Fitting (67)Least Squares Fitting (68)

(20)

Least Squares Fitting (69)Least Squares Fitting (70)Least Squares Fitting (71)

(21)

which are also written as

Least Squares Fitting (72)Least Squares Fitting (73)Least Squares Fitting (74)

(22)

Least Squares Fitting (75)Least Squares Fitting (76)Least Squares Fitting (77)

(23)

Least Squares Fitting (78)Least Squares Fitting (79)Least Squares Fitting (80)

(24)

Here, Least Squares Fitting (81) is the covariance and Least Squares Fitting (82) and Least Squares Fitting (83) are variances. Note that the quantities Least Squares Fitting (84) and Least Squares Fitting (85) can also be interpreted as the dot products

Least Squares Fitting (86)Least Squares Fitting (87)Least Squares Fitting (88)

(25)

Least Squares Fitting (89)Least Squares Fitting (90)Least Squares Fitting (91)

(26)

In terms of the sums of squares, the regression coefficient Least Squares Fitting (92) is given by

Least Squares Fitting (93)

(27)

and Least Squares Fitting (94) is given in terms of Least Squares Fitting (95) using (◇) as

Least Squares Fitting (96)

(28)

The overall quality of the fit is then parameterized in terms of a quantity known as the correlation coefficient, defined by

Least Squares Fitting (97)

(29)

which gives the proportion of Least Squares Fitting (98) which is accounted for by the regression.

Let Least Squares Fitting (99) be the vertical coordinate of the best-fit line with Least Squares Fitting (100)-coordinate Least Squares Fitting (101), so

Least Squares Fitting (102)

(30)

then the error between the actual vertical point Least Squares Fitting (103) and the fitted point is given by

Least Squares Fitting (104)

(31)

Now define Least Squares Fitting (105) as an estimator for the variance in Least Squares Fitting (106),

Least Squares Fitting (107)

(32)

Then Least Squares Fitting (108) can be given by

Least Squares Fitting (109)

(33)

(Acton 1966, pp.32-35; Gonick and Smith 1993, pp.202-204).

The standard errors for Least Squares Fitting (110) and Least Squares Fitting (111) are

Least Squares Fitting (112)Least Squares Fitting (113)Least Squares Fitting (114)

(34)

Least Squares Fitting (115)Least Squares Fitting (116)Least Squares Fitting (117)

(35)

See also

ANOVA, Correlation Coefficient, Interpolation, Least Squares Fitting--Exponential, Least Squares Fitting--Logarithmic, Least Squares Fitting--Perpendicular Offsets, Least Squares Fitting--Polynomial, Least Squares Fitting--Power Law, MANOVA, Matrix 1-Inverse, Moore-Penrose Matrix Inverse, Nonlinear Least Squares Fitting, Pseudoinverse, Regression Coefficient, Residual, Spline Explore this topic in the MathWorld classroom

Explore with Wolfram|Alpha

References

Acton, F.S. Analysis of Straight-Line Data. New York: Dover, 1966.Bevington, P.R. Data Reduction and Error Analysis for the Physical Sciences. New York: McGraw-Hill, 1969.Chatterjee, S.; Hadi, A.; and Price, B. "Simple Linear Regression." Ch.2 in Regression Analysis by Example, 3rd ed. New York: Wiley, pp.21-50, 2000.Edwards, A.L. "The Regression Line Least Squares Fitting (119) on Least Squares Fitting (120)." Ch.3 in An Introduction to Linear Regression and Correlation. San Francisco, CA: W.H. Freeman, pp.20-32, 1976.Farebrother, R.W. Fitting Linear Relationships: A History of the Calculus of Observations 1750-1900. New York: Springer-Verlag, 1999.Gauss, C.F. "Theoria combinationis obsevationum erroribus minimis obnoxiae." Werke, Vol.4. Göttingen, Germany: p.1, 1823.Gonick, L. and Smith, W. The Cartoon Guide to Statistics. New York: Harper Perennial, 1993.Kenney, J.F. and Keeping, E.S. "Linear Regression, Simple Correlation, and Contingency." Ch.8 in Mathematics of Statistics, Pt.2, 2nd ed. Princeton, NJ: Van Nostrand, pp.199-237, 1951.Kenney, J.F. and Keeping, E.S. "Linear Regression and Correlation." Ch.15 in Mathematics of Statistics, Pt.1, 3rd ed. Princeton, NJ: Van Nostrand, pp.252-285, 1962.Lancaster, P. and Šalkauskas, K. Curve and Surface Fitting: An Introduction. London: Academic Press, 1986.Laplace, P.S. "Des méthodes analytiques du Calcul des Probabilités." Ch.4 in Théorie analytique des probabilités, Livre 2, 3rd ed. Paris: Courcier, 1820.Lawson, C. and Hanson, R. Solving Least Squares Problems. Englewood Cliffs, NJ: Prentice-Hall, 1974.Ledvij, M. "Curve Fitting Made Easy." Industrial Physicist 9, 24-27, Apr./May 2003.Nash, J.C. Compact Numerical Methods for Computers: Linear Algebra and Function Minimisation, 2nd ed. Bristol, England: Adam Hilger, pp.21-24, 1990.Press, W.H.; Flannery, B.P.; Teukolsky, S.A.; and Vetterling, W.T. "Fitting Data to a Straight Line" "Straight-Line Data with Errors in Both Coordinates," and "General Linear Least Squares." §15.2, 15.3, and 15.4 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp.655-675, 1992.Whittaker, E.T. and Robinson, G. "The Method of Least Squares." Ch.9 in The Calculus of Observations: A Treatise on Numerical Mathematics, 4th ed. New York: Dover, pp.209-, 1967.York, D. "Least-Square Fitting of a Straight Line." Canad. J. Phys. 44, 1079-1086, 1966.

Referenced on Wolfram|Alpha

Least Squares Fitting

Cite this as:

Weisstein, Eric W. "Least Squares Fitting."From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/LeastSquaresFitting.html

Subject classifications

Least Squares Fitting (2024)
Top Articles
Stands Awakening Tier List - All Characters Ranked
Jotaro's Star Platinum
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Things to do in Wichita Falls on weekends 12-15 September
Craigslist Pets Huntsville Alabama
Paulette Goddard | American Actress, Modern Times, Charlie Chaplin
Red Dead Redemption 2 Legendary Fish Locations Guide (“A Fisher of Fish”)
What's the Difference Between Halal and Haram Meat & Food?
R/Skinwalker
Rugged Gentleman Barber Shop Martinsburg Wv
Jennifer Lenzini Leaving Ktiv
Justified - Streams, Episodenguide und News zur Serie
Epay. Medstarhealth.org
Olde Kegg Bar & Grill Portage Menu
Cubilabras
Half Inning In Which The Home Team Bats Crossword
Amazing Lash Bay Colony
Juego Friv Poki
Dirt Devil Ud70181 Parts Diagram
Truist Bank Open Saturday
Water Leaks in Your Car When It Rains? Common Causes & Fixes
What’s Closing at Disney World? A Complete Guide
New from Simply So Good - Cherry Apricot Slab Pie
Drys Pharmacy
Ohio State Football Wiki
Find Words Containing Specific Letters | WordFinder®
FirstLight Power to Acquire Leading Canadian Renewable Operator and Developer Hydromega Services Inc. - FirstLight
Joanna Gaines Reveals Who Bought the 'Fixer Upper' Lake House and Her Favorite Features of the Milestone Project
Tri-State Dog Racing Results
Navy Qrs Supervisor Answers
Trade Chart Dave Richard
Lincoln Financial Field Section 110
Free Stuff Craigslist Roanoke Va
Wi Dept Of Regulation & Licensing
Pick N Pull Near Me [Locator Map + Guide + FAQ]
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Arielle Torp

Last Updated:

Views: 6264

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Arielle Torp

Birthday: 1997-09-20

Address: 87313 Erdman Vista, North Dustinborough, WA 37563

Phone: +97216742823598

Job: Central Technology Officer

Hobby: Taekwondo, Macrame, Foreign language learning, Kite flying, Cooking, Skiing, Computer programming

Introduction: My name is Arielle Torp, I am a comfortable, kind, zealous, lovely, jolly, colorful, adventurous person who loves writing and wants to share my knowledge and understanding with you.