Share to: share facebook share twitter share wa share telegram print page

Curve fitting

Fitting of a noisy curve by an asymmetrical peak model, with an iterative process (Gauss–Newton algorithm with variable damping factor α).

Curve fitting[1][2] is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points,[3] possibly subject to constraints.[4][5] Curve fitting can involve either interpolation,[6][7] where an exact fit to the data is required, or smoothing,[8][9] in which a "smooth" function is constructed that approximately fits the data. A related topic is regression analysis,[10][11] which focuses more on questions of statistical inference such as how much uncertainty is present in a curve that is fitted to data observed with random errors. Fitted curves can be used as an aid for data visualization,[12][13] to infer values of a function where no data are available,[14] and to summarize the relationships among two or more variables.[15] Extrapolation refers to the use of a fitted curve beyond the range of the observed data,[16] and is subject to a degree of uncertainty[17] since it may reflect the method used to construct the curve as much as it reflects the observed data.

For linear-algebraic analysis of data, "fitting" usually means trying to find the curve that minimizes the vertical (y-axis) displacement of a point from the curve (e.g., ordinary least squares). However, for graphical and image applications, geometric fitting seeks to provide the best visual fit; which usually means trying to minimize the orthogonal distance to the curve (e.g., total least squares), or to otherwise include both axes of displacement of a point from the curve. Geometric fits are not popular because they usually require non-linear and/or iterative calculations, although they have the advantage of a more aesthetic and geometrically accurate result.[18][19][20]

Algebraic fitting of functions to data points

Most commonly, one fits a function of the form y=f(x).

Fitting lines and polynomial functions to data points

Polynomial curves fitting a sine function
Polynomial curves fitting points generated with a sine function. The black dotted line is the "true" data, the red line is a first degree polynomial, the green line is second degree, the orange line is third degree and the blue line is fourth degree.

The first degree polynomial equation

is a line with slope a. A line will connect any two points, so a first degree polynomial equation is an exact fit through any two points with distinct x coordinates.

If the order of the equation is increased to a second degree polynomial, the following results:

This will exactly fit a simple curve to three points.

If the order of the equation is increased to a third degree polynomial, the following is obtained:

This will exactly fit four points.

A more general statement would be to say it will exactly fit four constraints. Each constraint can be a point, angle, or curvature (which is the reciprocal of the radius of an osculating circle). Angle and curvature constraints are most often added to the ends of a curve, and in such cases are called end conditions. Identical end conditions are frequently used to ensure a smooth transition between polynomial curves contained within a single spline. Higher-order constraints, such as "the change in the rate of curvature", could also be added. This, for example, would be useful in highway cloverleaf design to understand the rate of change of the forces applied to a car (see jerk), as it follows the cloverleaf, and to set reasonable speed limits, accordingly.

The first degree polynomial equation could also be an exact fit for a single point and an angle while the third degree polynomial equation could also be an exact fit for two points, an angle constraint, and a curvature constraint. Many other combinations of constraints are possible for these and for higher order polynomial equations.

If there are more than n + 1 constraints (n being the degree of the polynomial), the polynomial curve can still be run through those constraints. An exact fit to all constraints is not certain (but might happen, for example, in the case of a first degree polynomial exactly fitting three collinear points). In general, however, some method is then needed to evaluate each approximation. The least squares method is one way to compare the deviations.

There are several reasons given to get an approximate fit when it is possible to simply increase the degree of the polynomial equation and get an exact match.:

  • Even if an exact match exists, it does not necessarily follow that it can be readily discovered. Depending on the algorithm used there may be a divergent case, where the exact fit cannot be calculated, or it might take too much computer time to find the solution. This situation might require an approximate solution.
  • The effect of averaging out questionable data points in a sample, rather than distorting the curve to fit them exactly, may be desirable.
  • Runge's phenomenon: high order polynomials can be highly oscillatory. If a curve runs through two points A and B, it would be expected that the curve would run somewhat near the midpoint of A and B, as well. This may not happen with high-order polynomial curves; they may even have values that are very large in positive or negative magnitude. With low-order polynomials, the curve is more likely to fall near the midpoint (it's even guaranteed to exactly run through the midpoint on a first degree polynomial).
  • Low-order polynomials tend to be smooth and high order polynomial curves tend to be "lumpy". To define this more precisely, the maximum number of inflection points possible in a polynomial curve is n-2, where n is the order of the polynomial equation. An inflection point is a location on the curve where it switches from a positive radius to negative. We can also say this is where it transitions from "holding water" to "shedding water". Note that it is only "possible" that high order polynomials will be lumpy; they could also be smooth, but there is no guarantee of this, unlike with low order polynomial curves. A fifteenth degree polynomial could have, at most, thirteen inflection points, but could also have eleven, or nine or any odd number down to one. (Polynomials with even numbered degree could have any even number of inflection points from n - 2 down to zero.)

The degree of the polynomial curve being higher than needed for an exact fit is undesirable for all the reasons listed previously for high order polynomials, but also leads to a case where there are an infinite number of solutions. For example, a first degree polynomial (a line) constrained by only a single point, instead of the usual two, would give an infinite number of solutions. This brings up the problem of how to compare and choose just one solution, which can be a problem for software and for humans, as well. For this reason, it is usually best to choose as low a degree as possible for an exact match on all constraints, and perhaps an even lower degree, if an approximate fit is acceptable.

Relation between wheat yield and soil salinity[21]

Fitting other functions to data points

Other types of curves, such as trigonometric functions (such as sine and cosine), may also be used, in certain cases.

In spectroscopy, data may be fitted with Gaussian, Lorentzian, Voigt and related functions.

In biology, ecology, demography, epidemiology, and many other disciplines, the growth of a population, the spread of infectious disease, etc. can be fitted using the logistic function.

In agriculture the inverted logistic sigmoid function (S-curve) is used to describe the relation between crop yield and growth factors. The blue figure was made by a sigmoid regression of data measured in farm lands. It can be seen that initially, i.e. at low soil salinity, the crop yield reduces slowly at increasing soil salinity, while thereafter the decrease progresses faster.

Geometric fitting of plane curves to data points

If a function of the form cannot be postulated, one can still try to fit a plane curve.

Other types of curves, such as conic sections (circular, elliptical, parabolic, and hyperbolic arcs) or trigonometric functions (such as sine and cosine), may also be used, in certain cases. For example, trajectories of objects under the influence of gravity follow a parabolic path, when air resistance is ignored. Hence, matching trajectory data points to a parabolic curve would make sense. Tides follow sinusoidal patterns, hence tidal data points should be matched to a sine wave, or the sum of two sine waves of different periods, if the effects of the Moon and Sun are both considered.

For a parametric curve, it is effective to fit each of its coordinates as a separate function of arc length; assuming that data points can be ordered, the chord distance may be used.[22]

Fitting a circle by geometric fit

Circle fitting with the Coope method, the points describing a circle arc, centre (1 ; 1), radius 4.
different models of ellipse fitting
Ellipse fitting minimising the algebraic distance (Fitzgibbon method).

Coope[23] approaches the problem of trying to find the best visual fit of circle to a set of 2D data points. The method elegantly transforms the ordinarily non-linear problem into a linear problem that can be solved without using iterative numerical methods, and is hence much faster than previous techniques.

Fitting an ellipse by geometric fit

The above technique is extended to general ellipses[24] by adding a non-linear step, resulting in a method that is fast, yet finds visually pleasing ellipses of arbitrary orientation and displacement.

Fitting surfaces

Note that while this discussion was in terms of 2D curves, much of this logic also extends to 3D surfaces, each patch of which is defined by a net of curves in two parametric directions, typically called u and v. A surface may be composed of one or more surface patches in each direction.

Software

Many statistical packages such as R and numerical software such as the gnuplot, GNU Scientific Library, Igor Pro, MLAB, Maple, MATLAB, TK Solver 6.0, Scilab, Mathematica, GNU Octave, and SciPy include commands for doing curve fitting in a variety of scenarios. There are also programs specifically written to do curve fitting; they can be found in the lists of statistical and numerical-analysis programs as well as in Category:Regression and curve fitting software.

See also

References

  1. ^ Sandra Lach Arlinghaus, PHB Practical Handbook of Curve Fitting. CRC Press, 1994.
  2. ^ William M. Kolb. Curve Fitting for Programmable Calculators. Syntec, Incorporated, 1984.
  3. ^ S.S. Halli, K.V. Rao. 1992. Advanced Techniques of Population Analysis. ISBN 0306439972 Page 165 (cf. ... functions are fulfilled if we have a good to moderate fit for the observed data.)
  4. ^ The Signal and the Noise: Why So Many Predictions Fail-but Some Don't. By Nate Silver
  5. ^ Data Preparation for Data Mining: Text. By Dorian Pyle.
  6. ^ Numerical Methods in Engineering with MATLAB®. By Jaan Kiusalaas. Page 24.
  7. ^ Numerical Methods in Engineering with Python 3. By Jaan Kiusalaas. Page 21.
  8. ^ Numerical Methods of Curve Fitting. By P. G. Guest, Philip George Guest. Page 349.
  9. ^ See also: Mollifier
  10. ^ Fitting Models to Biological Data Using Linear and Nonlinear Regression. By Harvey Motulsky, Arthur Christopoulos.
  11. ^ Regression Analysis By Rudolf J. Freund, William J. Wilson, Ping Sa. Page 269.
  12. ^ Visual Informatics. Edited by Halimah Badioze Zaman, Peter Robinson, Maria Petrou, Patrick Olivier, Heiko Schröder. Page 689.
  13. ^ Numerical Methods for Nonlinear Engineering Models. By John R. Hauser. Page 227.
  14. ^ Methods of Experimental Physics: Spectroscopy, Volume 13, Part 1. By Claire Marton. Page 150.
  15. ^ Encyclopedia of Research Design, Volume 1. Edited by Neil J. Salkind. Page 266.
  16. ^ Community Analysis and Planning Techniques. By Richard E. Klosterman. Page 1.
  17. ^ An Introduction to Risk and Uncertainty in the Evaluation of Environmental Investments. DIANE Publishing. Pg 69
  18. ^ Ahn, Sung-Joon (December 2008), "Geometric Fitting of Parametric Curves and Surfaces" (PDF), Journal of Information Processing Systems, 4 (4): 153–158, doi:10.3745/JIPS.2008.4.4.153, archived from the original (PDF) on 2014-03-13
  19. ^ Chernov, N.; Ma, H. (2011), "Least squares fitting of quadratic curves and surfaces", in Yoshida, Sota R. (ed.), Computer Vision, Nova Science Publishers, pp. 285–302, ISBN 9781612093994
  20. ^ Liu, Yang; Wang, Wenping (2008), "A Revisit to Least Squares Orthogonal Distance Fitting of Parametric Curves and Surfaces", in Chen, F.; Juttler, B. (eds.), Advances in Geometric Modeling and Processing, Lecture Notes in Computer Science, vol. 4975, pp. 384–397, CiteSeerX 10.1.1.306.6085, doi:10.1007/978-3-540-79246-8_29, ISBN 978-3-540-79245-1
  21. ^ Calculator for sigmoid regression
  22. ^ p.51 in Ahlberg & Nilson (1967) The theory of splines and their applications, Academic Press, 1967 [1]
  23. ^ Coope, I.D. (1993). "Circle fitting by linear and nonlinear least squares". Journal of Optimization Theory and Applications. 76 (2): 381–388. doi:10.1007/BF00939613. hdl:10092/11104. S2CID 59583785.
  24. ^ Paul Sheer, A software assistant for manual stereo photometrology, M.Sc. thesis, 1997

Further reading

  • N. Chernov (2010), Circular and linear regression: Fitting circles and lines by least squares, Chapman & Hall/CRC, Monographs on Statistics and Applied Probability, Volume 117 (256 pp.). [2]

Read other articles:

Mary Landrieu Mary Loretta Landrieu (* 23 November 1955 di Arlington, Virginia) adalah seorang politikus Amerika Serikat (Partai Demokrat). Sejak tahun 1997 ia menjadi Senator Amerika Serikat dari negara bagian Louisiana. Biografi Mary Landrieu adalah anak pertama dari 6 bersaudara anak mantan wali kota New Orleans, Maurice Edwin Moon Landrieu, dan istrinya Verna. Salah satu saudara Mary adalah seorang Wakil Gubernur Louisiana, Mitch Landrieu. Mary besar di New Orleans dan belajar di Louisiana S…

Franz BöhmeFranz BöhmeLahir15 April 1885Zeltweg, Kadipaten Steiermark, Austria-Hungaria kini AustriaMeninggal29 Mei 1947(1947-05-29) (umur 62)Nuremberg, Bayern, Wilayah pendudukan JermanDikebumikanSt. Leonhard-Friedhof, Graz, AustriaPengabdian Austria-Hungaria (hingga tahun 1918) Republik Austria Pertama (hingga tahun 1938) Jerman NaziDinas/cabangAngkatan Darat Austria-HungariaBundesheerWehrmachtLama dinas1900–1938 (Austria)1938–1945 (Jerman)PangkatGeneralmajor (Austria)Gene…

Electro Velvet Informations générales Pays d'origine Royaume-Uni Genre musical Electro swing Années actives Depuis 2015 Composition du groupe Membres Alex LarkeBianca Nicholas modifier Electro Velvet est un groupe de musique britannique d'electro swing composé d'Alex Larke et Bianca Nicholas. Le 7 mars 2015, ils sont choisis en interne pour représenter le Royaume-Uni au Concours Eurovision de la chanson 2015 à Vienne, en Autriche avec la chanson Still in Love with You[1]. Ils sont qualifi…

MozzarellaNegara asalItaliaKawasan, kotaCampania atau LatiumSumber susuSapi KerbauDipasteurisasiKadang-KadangTeksturLembutKadar lemak22%Waktu pematanganTidakSertifikasiMozzarella di Bufala CampanaSTG dan DOP 1996[1][2] Mozzarella adalah keju Italia yang dibuat dengan cara diputar dan dipotong, karena dalam bahasa Italia, mozzare berarti memotong.[3][4] Keju ini dibuat dari susu sapi ataupun susu kerbau. Mozzarella di bufala dibuat dari susu kerbau, sementara mozza…

2022 Indian film directed by Suraj Naai Sekar ReturnsTheatrical release posterDirected bySurajWritten bySurajProduced bySubaskaran AllirajahStarringVadiveluAnandarajRao RameshCinematographyVignesh VasuEdited bySelva R. KMusic bySanthosh Narayanan[1]ProductioncompanyLyca Productions[2]Release date 9 December 2022 (2022-12-09) Running time140 minutesCountryIndiaLanguageTamil Naai Sekar Returns is a 2022 Indian Tamil-language comedy film produced by Subaskaran Alliraj…

Adde Rosi Khoerunnisa Anggota Dewan Perwakilan RakyatPetahanaMulai menjabat 1 Oktober 2019Daerah pemilihanBanten IWakil Ketua Dewan Perwakilan Rakyat Daerah Provinsi BantenMasa jabatan4 April 2016 – 1 September 2019Menjabat bersama Ali Zamroni, Nur'aeni, dan MuflikhahKetua DPRDAsep Rahmatullah PendahuluS.M. HartonoPengganti Periode 2019–24 Bahrum H.S. Fahmi Hakim Budi Prajogo M. Nawa Said Dimyati Wakil Ketua Dewan Perwakilan Rakyat Daerah Kota SerangMasa jabatan2009 …

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada April 2016. Templat:InfoboxHj Unicode block Buginese adalah blok Unicode yang mengandung karakter penulisan bahasa Bugis yang dituturkan di Sulawesi, Indonesia. Buginese[1][2]Official Unicode Consortium code chart (PDF)   0 1 2 3 4 5 6 7 8 9 A B C D E F U+1A0x &#x…

Artikel ini tidak memiliki bagian pembuka yang sesuai dengan standar Wikipedia. Mohon tulis paragraf pembuka yang informatif sehingga pembaca dapat memahami maksud dari Al-Karaji. Contoh paragraf pembuka Al-Karaji adalah .... (Maret 2014) (Pelajari cara dan kapan saatnya untuk menghapus pesan templat ini) Hidrologi atau merupakan cabang ilmu bumi yang mempelajari pergerakan, distribusi, dan kualitas air di seluruh bumi, termasuk siklus hidrologi dan sumber daya air. Di era kejayaan peradaban Isl…

Bupati KaimanaLambang Bupati KaimanaPetahanaFreddy Thiesejak 26 April 2021Masa jabatan5 tahun (definitif)Dibentuk2003Situs webkaimanakab.go.id Kabupaten Kaimana dari awal berdirinya pada tahun 2003 hingga saat ini sudah pernah dipimpin oleh beberapa bupati. Berikut ini adalah Bupati Kaimana dari masa ke masa. No Bupati Awal menjabat Akhir menjabat Prd. Ket. Wakil Bupati — Hasan Achmad Aituarauw 2003 2005 — — 1 2005 2010 1 Drs. Matias Mairuma 2 Drs. Matias Mairuma 2010 2015 2 Burhanudi…

Lo stendardo del sultano. Lo stemma della monarchia omanita. La linea di successione al trono dell'Oman segue il criterio della legge salica. In Oman il trono spetta al figlio maggiore maschio del sultano. In assenza di un erede maschio, il sultano regnante può nominare suo successore un fratello o un altro parente di sesso maschile fra i discendenti del sultano Sa'id bin Sultan, sovrano fino al 1856. Il sultano Qabus dell'Oman non aveva figli ed aveva indicato che, dopo la sua morte, fosse la …

Visual guide that represents the skeletal framework of a website A wireframe document for a person profile view A website wireframe, also known as a page schematic or screen blueprint, is a visual guide that represents the skeletal framework of a website.[1]: 166  The term wireframe is taken from other fields that use a skeletal framework to represent 3 dimensional shape and volume.[2] Wireframes are created for the purpose of arranging elements to best accomplish…

Mahamadou Issoufou Presiden NigerMasa jabatan7 April 2011 – 2 April 2021Perdana MenteriBrigi Rafini PendahuluSalou Djibo (Ketua Dewan Tertinggi untuk Pemulihan Demokrasi)PenggantiMohamed BazoumPerdana Menteri NigerMasa jabatan17 April 1993 – 28 September 1994PresidenMahamane Ousmane PendahuluAmadou CheiffouPenggantiSouley Abdoulaye Informasi pribadiLahir1952 (umur 71–72)Dandaji, Afrika Barat Prancis (sekarang Niger)Partai politikPartai Niger untuk Demokrasi dan S…

Sporting event delegationSaint Vincent and the Grenadines at the2017 World Aquatics ChampionshipsFlag of Saint Vincent and the GrenadinesFINA codeVINNational federationSaint Vincent and the Grenadines Swimming Associationin Budapest, HungaryCompetitors2 in 1 sportMedals Gold 0 Silver 0 Bronze 0 Total 0 World Aquatics Championships appearances197319751978198219861991199419982001200320052007200920112013201520172019202220232024 Saint Vincent and the Grenadines competed at the 2017 World Aquatics Ch…

American politician and diplomat (1864–1928) For other people named Robert Lansing, see Robert Lansing (disambiguation). Robert Lansing42nd United States Secretary of StateIn officeJune 24, 1915 – February 13, 1920Acting: June 9 – 24, 1915PresidentWoodrow WilsonPreceded byWilliam Jennings BryanSucceeded byBainbridge Colby3rd Counselor of the United States Department of StateIn officeApril 1, 1914 – June 23, 1915PresidentWoodrow WilsonPreceded byJohn Bassett MooreSucceed…

International standards development organization ISO redirects here. For other uses, see ISO (disambiguation). International Organization for StandardizationOrganisation internationale de normalisationAbbreviationISOFormation23 February 1947; 77 years ago (1947-02-23)TypeNon-governmental organizationPurposeInternational standards developmentHeadquartersGeneva, SwitzerlandMembership 170 members(39 correspondents and4 subscribers)Official languages EnglishFrenchRussian[1]…

Frank Bagnack Nazionalità  Camerun Altezza 182 cm Peso 75 kg Calcio Ruolo Difensore Squadra  TSC Bačka Topola CarrieraGiovanili Samuel Eto'o Academy2008-2012 BarcellonaSquadre di club1 2012-2016 Barcellona B43 (1)2016 Nantes 28 (0)2016-2017 Real Saragozza7 (0)2017-2018 Admira Wacker M.1 (0)2018-2020 Olimpia Lubiana48 (2)2020-2021 Partizan16 (0)2021-2022 Qaırat14 (0)2023→  Pari Nižnij Novgorod0 (0)2023 Qaırat11 (1)2024- TSC B…

ХристианствоБиблия Ветхий Завет Новый Завет Евангелие Десять заповедей Нагорная проповедь Апокрифы Бог, Троица Бог Отец Иисус Христос Святой Дух История христианства Апостолы Хронология христианства Раннее христианство Гностическое христианство Вселенские соборы Ни…

HumbauvillecomuneHumbauville – Veduta LocalizzazioneStato Francia RegioneGrand Est Dipartimento Marna ArrondissementVitry-le-François CantoneVitry-le-François-Champagne et Der TerritorioCoordinate48°40′N 4°25′E / 48.666667°N 4.416667°E48.666667; 4.416667 (Humbauville)Coordinate: 48°40′N 4°25′E / 48.666667°N 4.416667°E48.666667; 4.416667 (Humbauville) Superficie17,4 km² Abitanti73[1] (2009) Densità4,2 ab./km² Altre …

この項目には、一部のコンピュータや閲覧ソフトで表示できない文字が含まれています(詳細)。 数字の大字(だいじ)は、漢数字の一種。通常用いる単純な字形の漢数字(小字)の代わりに同じ音の別の漢字を用いるものである。 概要 壱万円日本銀行券(「壱」が大字) 弐千円日本銀行券(「弐」が大字) 漢数字には「一」「二」「三」と続く小字と、「壱」「弐」…

この項目には、一部のコンピュータや閲覧ソフトで表示できない文字が含まれています(詳細)。 数字の大字(だいじ)は、漢数字の一種。通常用いる単純な字形の漢数字(小字)の代わりに同じ音の別の漢字を用いるものである。 概要 壱万円日本銀行券(「壱」が大字) 弐千円日本銀行券(「弐」が大字) 漢数字には「一」「二」「三」と続く小字と、「壱」「弐」…

Kembali kehalaman sebelumnya