Download PDF

See NB

Curve-Fitting To
Discrete Data

 

Download

Mathematica Notebook

 

All material in this page can be copied to www.wikipedia.org without author's approval

Important Notes

1- Relative Goodness-of-Fit: In this research, the author tries to provide a robust technique for determining goodness-of-fit that does not need a visual intervention. In the suggested algorithm, the outlier points shall be automatically given negligible weight. Therefore, the outlier points will not affect the result of goodness-of-fit. The algorithm assumes there is more than a single fit and we need to choose the best. Follow this link to see details...

2- Least-Squares Fit (LSF) is a very important and; hence, a very popular curve-fitting technique. It has enormous applications in approximation methods and certainly is considered a fair gauge when theoritical impartiality is sought in curve-fitting problems. In this research the author has provided a detailed explanation for the derivation of LSF formulas (including the Constrained LSF). What's new is: the explanation of methodology when Mathematica package is used to derive general formulas in terms of summations. Follow this link to see details...

3- Minimax Fitting, or Min-Max Fitting (MMF) has also proved to be a popular fit due to the fact that it will minimize the maximum error, which occurs at certain points. The theory is attributed to Chebyshev (and others), and has proved its importance in approximation. In this research there is nothing new about it. Even the native programs provided as Mathematica notebooks are very slow, but correct! A Mathematica notebook was provided to solve minimax fits for linear-pattern functions with three parameters y = a p(x) + b q(x) + c r(x). An alternative algorithm was followed to solve minimax straight line (or what is called Chebyshev line). This algorithm follows the fact that the important points to solve minimax line are the knots of convex hull. Therefore, this algorithm is fast and can deal with thousands of points in a short time. Follow this link to see details...

4- Least Sum of Absolute Deviations Fit (ADF) described in this research deales with finding the first possible solution by searching all possible combinations. This method can provide better fits than least squares fits upon existance of irregular points (that can serve as magnets to the LSF approximations and result in an unrealistic fit). This method is not popular because it takes a lot of computing time and because solution is not unique. The author provided many sample programs to solve this fit using the first possible solution by exploring all possible combinations. Follow this link to see details...

5- Orthogonal Distance Least Squares Fit (ODLSF) is a fit that minimizes the sum of either absolute or squared residuals of orthogonal distances between the emperical points and the fit.  Constrained ODLSF formulas of straight line that is forced through a point were also provided. Though this method is not favourable, but the author of this website made it available and shed some light on case studies. Follow this link to see details...

Points

For quick visual comparison, the following points are used:

Number of points is n = 20
x = { 1, 2,  3,   4,  5,   6,   7,   8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
y = {-6, 2, -1, 14, 11, 30, 11, 50, 36, 32, 43, 67, 60, 51, 54, 93, 63, 88, 86, 95}
y set is generated by Mathematica using SeedRandom[2009]; and,
y_i = 5x_i - 7 + Random[Integer, {-20, 20}]

For simplicity, all fits are chosen here to be straight-line fits.

Minimum Sum of Squared Residues (Least-Squares Fit) LSF

[Graphics:HTMLFiles/index_5.gif]

Minimum sum of squared residues fit is FormBox[RowBox[{y, =,  , RowBox[{RowBox[{5.16617, x}], -, 10.2947}]}], TraditionalForm]  

Least Maximum Error (Minimax Fitting) MMF

[Graphics:HTMLFiles/index_7.gif]

Minimax "Chebyshev" linear  fit is FormBox[RowBox[{y, =,  , RowBox[{RowBox[{5.2, x}], -, 7.8}]}], TraditionalForm] with a line passing through three points: (7, 11),  (16, 93) and  (17, 63). Absolute maximum error that occurs at these three points is the maximum error over all points. In this case  FormBox[RowBox[{| h |, =, 17.6}], TraditionalForm].

Least Sum of Absolute Deviations (Absolute Deviations Fit) ADF

[Graphics:HTMLFiles/index_13.gif]

Least sum of absolute residuals fit is FormBox[RowBox[{y, =,  , RowBox[{RowBox[{5.25, x}], -, 11.25}]}], TraditionalForm] with a line passing by the points: (1, -6)and   (9, 36).

Orthogonal Distances Least Squares Fitting ODLSF

[Graphics:HTMLFiles/index_17.gif]

Minimum sum of least squared distance residues fit is FormBox[RowBox[{y, =,  , RowBox[{RowBox[{5.74528, x}], -, 16.3755}]}], TraditionalForm]

Important Note:

    The pages of this website are all provided with links to full listing of Mathematica code used to generate the results shown herein. Thererfore, Mathematica users will have more advantage of this web research. The author used Mathematica 5.0 to program and output all the results of this research.  

Contact Information and Citation of This Research

   
  NB: Due to some bug in converting this document into PDF Adobe Acrobat version, sometimes the plots appear in PDF version as if they have extra point(s) on some corner(s) of the plot area. Please forgive the author for this inconvenience. The author suggests that in case of printing this research, the printing should be done directly from within Mathematica notebook to the printer. The bug is due to either Mathematica or the PDF converter. In case it is due to Mathematica, then it's better to convert the graphic cells into a bitmap image, because keeping the graphic cell into PostScript format will retain the problem. This conversion comes on the cost of resolution.
   
  For any notes or suggestions please write to: dabbagh@maktoob.com
   
  (c) 2009 Mohamed Al-Dabbagh
   
  If the website is up and running, cite this page as hyperlinked in the form:
   Mohamed Al-Dabbagh, Curve-fitting to Discrete Data, http://cf.net16.net/, Web Research (published 2009)
   
  If the website does no longer exist or the host has shot it down, cite this page as:
   
  Mohamed Al-Dabbagh, Curve-fitting to Discrete Data, Web Research (published 2009). Website is not active. Contact the author on dabbagh@maktoob.com, or cell phone: (+967) 7117 0 4224
   
   
   


Free web hostingWeb hosting