|
"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
|