Thread Subject: exponential fitting?

Subject: exponential fitting?

From: Mario

Date: 26 Sep, 2008 17:15:04

Message: 1 of 4

Hi..
I'm dealing with this kind of data
 
x=[527.3756 546.1192 564.9728 586.4216 608.2959 630.5845 652.8730 674.8214 697.0359]

y=[193 204.1192 214.9728 219 222 224 222 219.1786 217]

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?
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)

Hope you can help me!
Regards,

Mario

Subject: exponential fitting?

From: John D'Errico

Date: 26 Sep, 2008 17:42:01

Message: 2 of 4

"Mario " <nospam@yahoo.com> wrote in message <gbj5ao$1rr$1@fred.mathworks.com>...
> Hi..
> I'm dealing with this kind of data
>
> x=[527.3756 546.1192 564.9728 586.4216 608.2959 630.5845 652.8730 674.8214 697.0359]
>
> y=[193 204.1192 214.9728 219 222 224 222 219.1786 217]
>
> 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?
> 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)
>
> Hope you can help me!

That might be the best curve to fit your
class of data, but that data does not fit
your choice of model even slightly well.

Note that it rolls over, something an
exponential cannot do.

Worse, suppose that you did find a set
of coefficients for that model. The fact
that it MUST pass through (0,0) forces
the shape of the curve to not fit this data.

Sorry, but this is a TERRIBLE choice of
model for your data. That is reflected
in the poor resulting fits that you find.

John

Subject: exponential fitting?

From: Mario

Date: 26 Sep, 2008 20:36:02

Message: 3 of 4

Thank you for your post!
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 "grade of curvature". What do you suggest? Keep using the quadratic curve or try something else?

Mario

Subject: exponential fitting?

From: John D'Errico

Date: 26 Sep, 2008 22:26:02

Message: 4 of 4

"Mario " <nospam@yahoo.com> wrote in message <gbjh3i$mnk$1@fred.mathworks.com>...
> Thank you for your post!
> 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 "grade of curvature". What do you suggest? Keep using the quadratic curve or try something else?

Often, rather than fitting a nonlinear model,
a spline is a better choice. So, I tried a least
squares spline on your data. As it turns out,
even a 3 knot least square spline (with properly
chosen end conditions) fit your curve quite well.

Then I looked at the second derivative of the
spline model. Since the spine was a cubic
spline, the second derivative curve is a
piecewise linear function. More interestingly,
that curve was almost purely linear across
the two pieces, i.e., the slope of the second
derivative function was nearly constant.

The point is, if a function with linear second
derivative fits your data well, then the function
is just a cubic polynomial. I did not even need
to fit something as complicated as a cubic
spline. A pure cubic polynomial would have
fared adequately. You can do this with polyfit.

What does all of this tell you? A moderately
low order polynomial model will suffice, but
don't expect to be able to estimate a single
curvature parameter.

HTH,
John

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com