<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Can we get an exact curve fitting line?</title>
    <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Tue, 09 Jun 2026 09:29:49 GMT</lastBuildDate>
    <pubDate>Tue, 09 Jun 2026 09:29:49 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Can we get an exact curve fitting line?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Can we get an exact curve fitting line?</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line</link>
    </image>
    <item>
      <title>Hermite interpolation and Hermite spline</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line?ref=Feed:MaplePrimes:Can we get an exact curve fitting line?:Comments#answer120078</link>
      <itunes:summary>&lt;p&gt;You could try a &lt;a href="http://en.wikipedia.org/wiki/Hermite_interpolation"&gt;Hermite interpolation&lt;/a&gt; and a proper &lt;a href="http://en.wikipedia.org/wiki/Cubic_Hermite_spline"&gt;Hermite spline&lt;/a&gt; (which, probably, would require more data entered).&lt;/p&gt;
&lt;p&gt;It's easier in Mathematica,&lt;/p&gt;
&lt;pre&gt;L = {3, 4, 6, 7, 2, 3, 5, 4, 6, 8, 20, 4, 5, 12, 0, 5, 5, 5, 3};

Show[Plot[ListInterpolation[L][x], {x, 1, 19}], ListPlot[L]]
&lt;/pre&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=120078/382918/Hermite.png"&gt;&lt;img src="/view.aspx?sf=120078/382918/Hermite.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Alec&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;You could try a &lt;a href="http://en.wikipedia.org/wiki/Hermite_interpolation"&gt;Hermite interpolation&lt;/a&gt; and a proper &lt;a href="http://en.wikipedia.org/wiki/Cubic_Hermite_spline"&gt;Hermite spline&lt;/a&gt; (which, probably, would require more data entered).&lt;/p&gt;
&lt;p&gt;It's easier in Mathematica,&lt;/p&gt;
&lt;pre&gt;L = {3, 4, 6, 7, 2, 3, 5, 4, 6, 8, 20, 4, 5, 12, 0, 5, 5, 5, 3};

Show[Plot[ListInterpolation[L][x], {x, 1, 19}], ListPlot[L]]
&lt;/pre&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=120078/382918/Hermite.png"&gt;&lt;img src="/view.aspx?sf=120078/382918/Hermite.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Alec&lt;/p&gt;</description>
      <guid>120078</guid>
      <pubDate>Fri, 20 May 2011 05:11:34 Z</pubDate>
      <itunes:author>Alec Mihailovs</itunes:author>
      <author>Alec Mihailovs</author>
    </item>
    <item>
      <title>Curve Fitting Options</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line?ref=Feed:MaplePrimes:Can we get an exact curve fitting line?:Comments#answer120080</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line#comment120076"&gt;@Christopher2222&lt;/a&gt; The oscillations and overshoots become more likely as the degree of the interpolating polynomial increases. One possibility to combat this effect is to use interpolating piecewise polynomials (often b-splines). Maple supports this.&lt;/p&gt;
&lt;p&gt;Another option is to relax your search and not insist that the approximation interpolate the data. If you look for a best fitting curve it won't pass through most points, but overall it will reflect various general trends within the data set. You do appear to want quite a bit of turning throughout the interval, so this might not be so appropriate.&lt;/p&gt;
&lt;p&gt;If you really know where your curve will have critical points and inflection points, these become additional constraints. While, in principle, these require higher-order polynomials, they often have other oscillations in addition to the ones prescribed and so might not be any better than what you are seing at present. I think I might be tempted to utilize piecewise cubic (or quartic) with additional constraints at the transition points between cubics to ensure that the overall curve is continuous and that an appropriate number of derivatives agree at the transition points.&lt;/p&gt;
&lt;p&gt;I hope at least one of these ideas makes some sense to you, and that you are able to put these ideas to good use. Post again if you have more questions or encounter any problems.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line#comment120076"&gt;@Christopher2222&lt;/a&gt; The oscillations and overshoots become more likely as the degree of the interpolating polynomial increases. One possibility to combat this effect is to use interpolating piecewise polynomials (often b-splines). Maple supports this.&lt;/p&gt;
&lt;p&gt;Another option is to relax your search and not insist that the approximation interpolate the data. If you look for a best fitting curve it won't pass through most points, but overall it will reflect various general trends within the data set. You do appear to want quite a bit of turning throughout the interval, so this might not be so appropriate.&lt;/p&gt;
&lt;p&gt;If you really know where your curve will have critical points and inflection points, these become additional constraints. While, in principle, these require higher-order polynomials, they often have other oscillations in addition to the ones prescribed and so might not be any better than what you are seing at present. I think I might be tempted to utilize piecewise cubic (or quartic) with additional constraints at the transition points between cubics to ensure that the overall curve is continuous and that an appropriate number of derivatives agree at the transition points.&lt;/p&gt;
&lt;p&gt;I hope at least one of these ideas makes some sense to you, and that you are able to put these ideas to good use. Post again if you have more questions or encounter any problems.&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description>
      <guid>120080</guid>
      <pubDate>Fri, 20 May 2011 09:13:09 Z</pubDate>
      <itunes:author>Doug Meade</itunes:author>
      <author>Doug Meade</author>
    </item>
    <item>
      <title>Hermite splines</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line?ref=Feed:MaplePrimes:Can we get an exact curve fitting line?:Comments#answer120137</link>
      <itunes:summary>&lt;p&gt;I've just produced the following picture in Maple using cubic Hermite splines,&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=120137/382999/Hermite.gif"&gt;&lt;img src="/view.aspx?sf=120137/382999/Hermite.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;Is it what you wanted?&lt;/p&gt;
&lt;p&gt;_______________&lt;br&gt; Alec Mihailovs, PhD&lt;/p&gt;
&lt;p&gt;PS I put the procedures in a &lt;a href="http://www.mapleprimes.com/posts/120138-Exact-Cubic-Hermite-Spline"&gt;separate post&lt;/a&gt;. -Alec&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I've just produced the following picture in Maple using cubic Hermite splines,&lt;/p&gt;
&lt;p&gt;&lt;a href="/view.aspx?sf=120137/382999/Hermite.gif"&gt;&lt;img src="/view.aspx?sf=120137/382999/Hermite.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;Is it what you wanted?&lt;/p&gt;
&lt;p&gt;_______________&lt;br&gt; Alec Mihailovs, PhD&lt;/p&gt;
&lt;p&gt;PS I put the procedures in a &lt;a href="http://www.mapleprimes.com/posts/120138-Exact-Cubic-Hermite-Spline"&gt;separate post&lt;/a&gt;. -Alec&lt;/p&gt;</description>
      <guid>120137</guid>
      <pubDate>Sat, 21 May 2011 06:55:42 Z</pubDate>
      <itunes:author>Alec Mihailovs</itunes:author>
      <author>Alec Mihailovs</author>
    </item>
    <item>
      <title>Smooth...</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line?ref=Feed:MaplePrimes:Can we get an exact curve fitting line?:Comments#comment120101</link>
      <itunes:summary>&lt;p&gt;Alec, is it possible to use that method while maintainng smothness ?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Alec, is it possible to use that method while maintainng smothness ?&lt;/p&gt;</description>
      <guid>120101</guid>
      <pubDate>Fri, 20 May 2011 13:56:31 Z</pubDate>
      <itunes:author>longrob</itunes:author>
      <author>longrob</author>
    </item>
    <item>
      <title>cspline</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line?ref=Feed:MaplePrimes:Can we get an exact curve fitting line?:Comments#comment120106</link>
      <itunes:summary>&lt;p&gt;So maybe the Cubic Hermite Spline (cspline)&amp;nbsp;is what I&amp;nbsp;need.&amp;nbsp; From the wikipedia page link Alec provided the finite difference method or finite difference tangents looks promising.&amp;nbsp; I just need to interperet all that algebra (makes my head spin) into maple code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;would need&amp;nbsp;some help creating&amp;nbsp;this cspline procedure.&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;So maybe the Cubic Hermite Spline (cspline)&amp;nbsp;is what I&amp;nbsp;need.&amp;nbsp; From the wikipedia page link Alec provided the finite difference method or finite difference tangents looks promising.&amp;nbsp; I just need to interperet all that algebra (makes my head spin) into maple code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;would need&amp;nbsp;some help creating&amp;nbsp;this cspline procedure.&amp;nbsp;&lt;/p&gt;</description>
      <guid>120106</guid>
      <pubDate>Fri, 20 May 2011 17:33:36 Z</pubDate>
      <itunes:author>Christopher2222</itunes:author>
      <author>Christopher2222</author>
    </item>
    <item>
      <title>smoothness</title>
      <link>http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line?ref=Feed:MaplePrimes:Can we get an exact curve fitting line?:Comments#comment120109</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line#comment120101"&gt;@longrob&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sure, just requires some manual adjusting, adding derivative values, for instance, and second derivatives may be added etc. - there are many examples in the Mathematica help - it has options Method-&amp;gt;Spline, which produces a more smooth looking curve, Method-&amp;gt;Hermite etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On the other hand, for such irregularly oscillating data as in this particular example, a simple line graph (not smooth) - i.e. just connecting the points with line segments, gives, maybe, even better idea about what is happening - and it can be easily done in Maple using &lt;strong&gt;plot&lt;/strong&gt;; maybe with adding moving average, which is available in the Statistics package in Maple if I recall correctly - I'll check it later.&lt;/p&gt;
&lt;p&gt;Alec&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/120057-Can-We-Get-An-Exact-Curve-Fitting-Line#comment120101"&gt;@longrob&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sure, just requires some manual adjusting, adding derivative values, for instance, and second derivatives may be added etc. - there are many examples in the Mathematica help - it has options Method-&amp;gt;Spline, which produces a more smooth looking curve, Method-&amp;gt;Hermite etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On the other hand, for such irregularly oscillating data as in this particular example, a simple line graph (not smooth) - i.e. just connecting the points with line segments, gives, maybe, even better idea about what is happening - and it can be easily done in Maple using &lt;strong&gt;plot&lt;/strong&gt;; maybe with adding moving average, which is available in the Statistics package in Maple if I recall correctly - I'll check it later.&lt;/p&gt;
&lt;p&gt;Alec&lt;/p&gt;</description>
      <guid>120109</guid>
      <pubDate>Fri, 20 May 2011 18:22:29 Z</pubDate>
      <itunes:author>Alec Mihailovs</itunes:author>
      <author>Alec Mihailovs</author>
    </item>
  </channel>
</rss>