Least Squares Fitting of Data to a Curve
[Pages:64]Least Squares Fitting of Data to a Curve
Gerald Recktenwald Portland State University Department of Mechanical Engineering
gerry@me.pdx.edu
These slides are a supplement to the book Numerical Methods with Matlab: Implementations and Applications, by Gerald W. Recktenwald, c 2000?2007, Prentice-Hall, Upper Saddle River, NJ. These slides are copyright c 2000?2007 Gerald W. Recktenwald. The PDF version of these slides may be downloaded or stored or printed only for noncommercial, educational use. The repackaging or sale of these slides in any form, without written consent of the author, is prohibited. The latest version of this PDF file, along with other supplemental material for the book, can be found at recktenwald or web.cecs.pdx.edu/~gerry/nmm/.
Version 0.82 November 6, 2007
page 1
Overview
? Fitting a line to data Geometric interpretation Residuals of the overdetermined system The normal equations
? Nonlinear fits via coordinate transformation ? Fitting arbitrary linear combinations of basis functions
Mathematical formulation Solution via normal equations Solution via QR factorization ? Polynomial curve fits with the built-in polyfit function ? Multivariate fitting
NMM: Least Squares Curve-Fitting
page 2
Fitting a Line to Data
Given m pairs of data: (xi, yi), i = 1, . . . , m
Find the coefficients and such that
F (x) = x +
is a good fit to the data Questions: ? How do we define good fit? ? How do we compute and after a definition of "good fit" is obtained?
NMM: Least Squares Curve-Fitting
page 3
Plausible Fits
Plausible fits are obtained by adjusting the
5
slope () and intercept (). Here is a
graphical representation of potential fits to a
4
particular set of data
y
3
Which of the lines provides the best fit?
2
1 123456 x
NMM: Least Squares Curve-Fitting
page 4
The Residual
The difference between the given yi value
5
and the fit function evaluated at xi is
4
ri = yi - F (xi)
y
= yi - (xi + )
3
ri is the residual for the data pair (xi, yi).
ri is the vertical distance between the known data and the fit function.
2 1
123456 x
NMM: Least Squares Curve-Fitting
page 5
Minimizing the Residual
Two criteria for choosing the "best" fit
X
X
minimize |ri| or minimize ri2
For statistical and computational reasons choose minimization of = P ri2 X m
= [yi - (xi + )]2
i=1
The best fit is obtained by the values of and that minimize .
NMM: Least Squares Curve-Fitting
page 6
Orthogonal Distance Fit
An alternative to minimizing the
y
residual is to minimize the orthogonal
distance to the line. Minimizing P d2i is known as the Orthogonal Distance Regression
problem.
See, e.g., ?Ake Bjo?rk, Numerical Methods for Least Squares Problems,
1996, SIAM, Philadelphia.
d3
d4
d2 d1
x1
x2
x3
x4
NMM: Least Squares Curve-Fitting
page 7
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- least squares fitting of data to a curve
- regression and calibration
- calibration curve guide
- calibration and linear regression analysis a self guided
- regression diagnostic plots
- model checking techniques based on cumulative residuals
- lesson 3 residuals and coefficient of determination
- lecture notes 7 residual analysis and multiple
- least squares regression line and residual plots ccmr notes
- residue curve maps chemstations 2018
Related searches
- benefits of going to a community college
- how to graph least squares regression line
- how to use least squares regression
- how to find least squares regression equation
- least squares regression line calculator a value
- how to find least squares regression line
- the ratio of 18 to a number
- how to compute the least squares regression
- derivative of e to a function
- least squares fitting matlab
- famous words of sympathy to a family
- least squares curve calculator