<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/236628</link>
    <title>MATLAB Central Newsreader - exponential fitting?</title>
    <description>Feed for thread: exponential fitting?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 26 Sep 2008 17:15:04 -0400</pubDate>
      <title>exponential fitting?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/236628#602376</link>
      <author>Mario </author>
      <description>Hi..&lt;br&gt;
I'm dealing with this kind of data&lt;br&gt;
&amp;nbsp;&lt;br&gt;
x=[527.3756  546.1192  564.9728  586.4216  608.2959  630.5845  652.8730  674.8214  697.0359]&lt;br&gt;
&lt;br&gt;
y=[193  204.1192  214.9728  219  222  224 222 219.1786  217]&lt;br&gt;
&lt;br&gt;
and i would like to fit a*(1-exp(b*x))   (because i think it's the best curve that fits these points) and i tried to do it but i didn't get a good fit! What am i doing wrong?&lt;br&gt;
I even tried to scale the data in order to place the first point in [0,0] but it didn't work as i expected (the exponential curve fit the points after it grows, so it fits the point with a line almost)&lt;br&gt;
&lt;br&gt;
Hope you can help me! &lt;br&gt;
Regards,&lt;br&gt;
&lt;br&gt;
Mario</description>
    </item>
    <item>
      <pubDate>Fri, 26 Sep 2008 17:42:01 -0400</pubDate>
      <title>Re: exponential fitting?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/236628#602381</link>
      <author>John D'Errico</author>
      <description>&quot;Mario &quot; &amp;lt;nospam@yahoo.com&amp;gt; wrote in message &amp;lt;gbj5ao$1rr$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi..&lt;br&gt;
&amp;gt; I'm dealing with this kind of data&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; x=[527.3756  546.1192  564.9728  586.4216  608.2959  630.5845  652.8730  674.8214  697.0359]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; y=[193  204.1192  214.9728  219  222  224 222 219.1786  217]&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; and i would like to fit a*(1-exp(b*x))   (because i think it's the best curve that fits these points) and i tried to do it but i didn't get a good fit! What am i doing wrong?&lt;br&gt;
&amp;gt; I even tried to scale the data in order to place the first point in [0,0] but it didn't work as i expected (the exponential curve fit the points after it grows, so it fits the point with a line almost)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hope you can help me! &lt;br&gt;
&lt;br&gt;
That might be the best curve to fit your&lt;br&gt;
class of data, but that data does not fit&lt;br&gt;
your choice of model even slightly well.&lt;br&gt;
&lt;br&gt;
Note that it rolls over, something an&lt;br&gt;
exponential cannot do.&lt;br&gt;
&lt;br&gt;
Worse, suppose that you did find a set&lt;br&gt;
of coefficients for that model. The fact&lt;br&gt;
that it MUST pass through (0,0) forces&lt;br&gt;
the shape of the curve to not fit this data.&lt;br&gt;
&lt;br&gt;
Sorry, but this is a TERRIBLE choice of&lt;br&gt;
model for your data. That is reflected&lt;br&gt;
in the poor resulting fits that you find.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Fri, 26 Sep 2008 20:36:02 -0400</pubDate>
      <title>Re: exponential fitting?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/236628#602421</link>
      <author>Mario </author>
      <description>Thank you for your post!&lt;br&gt;
What i'd want to measure is the coefficient of curvature of this data. I got good results using a quadratic curve (and taking the coefficient of x^2) but i was wondering if there was a better way to get this &quot;grade of curvature&quot;. What do you suggest? Keep using the quadratic curve or try something else?&lt;br&gt;
&lt;br&gt;
Mario</description>
    </item>
    <item>
      <pubDate>Fri, 26 Sep 2008 22:26:02 -0400</pubDate>
      <title>Re: exponential fitting?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/236628#602441</link>
      <author>John D'Errico</author>
      <description>&quot;Mario &quot; &amp;lt;nospam@yahoo.com&amp;gt; wrote in message &amp;lt;gbjh3i$mnk$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thank you for your post!&lt;br&gt;
&amp;gt; What i'd want to measure is the coefficient of curvature of this data. I got good results using a quadratic curve (and taking the coefficient of x^2) but i was wondering if there was a better way to get this &quot;grade of curvature&quot;. What do you suggest? Keep using the quadratic curve or try something else?&lt;br&gt;
&lt;br&gt;
Often, rather than fitting a nonlinear model,&lt;br&gt;
a spline is a better choice. So, I tried a least&lt;br&gt;
squares spline on your data. As it turns out,&lt;br&gt;
even a 3 knot least square spline (with properly&lt;br&gt;
chosen end conditions) fit your curve quite well.&lt;br&gt;
&lt;br&gt;
Then I looked at the second derivative of the&lt;br&gt;
spline model. Since the spine was a cubic&lt;br&gt;
spline, the second derivative curve is a&lt;br&gt;
piecewise linear function. More interestingly,&lt;br&gt;
that curve was almost purely linear across&lt;br&gt;
the two pieces, i.e., the slope of the second&lt;br&gt;
derivative function was nearly constant.&lt;br&gt;
&lt;br&gt;
The point is, if a function with linear second&lt;br&gt;
derivative fits your data well, then the function&lt;br&gt;
is just a cubic polynomial. I did not even need&lt;br&gt;
to fit something as complicated as a cubic&lt;br&gt;
spline. A pure cubic polynomial would have&lt;br&gt;
fared adequately. You can do this with polyfit.&lt;br&gt;
&lt;br&gt;
What does all of this tell you? A moderately&lt;br&gt;
low order polynomial model will suffice, but&lt;br&gt;
don't expect to be able to estimate a single&lt;br&gt;
curvature parameter.&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
John</description>
    </item>
  </channel>
</rss>

