Re: How to get the equation of a curve fitting experimental data?



In article <ef21814.-1@xxxxxxxxxxxxxxxx>, Indira <iremond@xxxxxxxxxxx> wrote:

> I am dealing with a set of experimental data y.
> I would like to fit a curve to this set of data and get the equation
> of this curve in order to reach the primitive function Y of y.
> I tried 'polyfit' which actually gives the coefficients of the
> fitting polynomial... the problem is:
> 1- it doesn't fit that accurately the data
> 2- I get the following warning:
> Warning: Polynomial is badly conditioned. Remove repeated data points
> or try centering and scaling as described in HELP POLYFIT.
> > In polyfit at 79
>
> The cubic spline interpolation fits the data better... but it doesn't
> provide any equation for the fitting curve.
>
> Is there any other built-in function that could help here?


Curve fitting is an ill posed problem of a sort.
Especially so if you wish some way to automatically
identify the model form itself from data. Add in
the potential of noise in the data, and its a
dreadful task.

Typically one must start with some form of model.
In essence, you must provide some sort of prior
information. As I always look at these problems
through the eyes of a Bayesian, prior information
is a natural idea. The fact is however, you, as
the scientist/engineer/experimentor have a wealth
of knowledge about the system that you are studying.
So you should be able to provide some of that
knowledge to the modeling effort. If not, then
we are left with nothing to aid us in the dreadful
task I described above.

I've danced around this issue so far. Really the
only solution in matlab (currently) is to use
some variety of nonlinear model that the user
must pose, then use a linear/nonlinear regression
to estimate the coefficients for. Choosing that
model form has a bit magic around it. Its a skill
that one learns, learning different fundamental
model shapes and how to combine them into a
nonlinear empirical model. Or one learns to build
models more from first principles. These often
result in what I'll call metaphorical models. The
cubic spline is the masterpiece of metaphorical
models - a model of a thin flexible beam,
abstracted as a mathematical metaphor to model
systems of all types.

Sorry. I still appear to be dancing. Its because
I can't help you directly at this time. You may
wish to look into the splines toolbox, or the
curvefitting toolbox. The statistics and
optimization toolboxes also have modeling tools
that might prove useful.

I'd avoid polynomial models. While they can offer
simple predictive models, they would never be my
choice.

HTH,
John D'Errico


--
The best material model of a cat is another, or preferably the same, cat.
A. Rosenblueth, Philosophy of Science, 1945

Those who can't laugh at themselves leave the job to others.
Anonymous
.



Relevant Pages

  • Only 7.8 Billion (was: 9 Billion. The Population Explosion Is At And End.)
    ... This does, in fact, fit very well. ... deviations of about 10-20 million and is not a direct fit. ... The results of fitting this to the above-mentioned regularity ... surprising recent development in the world population curve. ...
    (sci.anthropology)
  • Re: comparison of two distribution curves
    ... john wrote: ... > is it as simple as saying that a straight line has a good fit to the ... Do a one-way anova on the control condition. ... Fit a curve to each condition. ...
    (sci.stat.edu)
  • Re: nlinfit vs. lsqcurvefit
    ... I have a question regading the use of either nlinfit vs. lsqcurvefit. ... I have a number of data that I want to fit with a curve (I know the ... regardless of which optimizer you use. ...
    (comp.soft-sys.matlab)
  • Re: How to get the equation of a curve fitting experimental data?
    ... >> I would like to fit a curve to this set of data and get the equation ... >> of this curve in order to reach the primitive function Y of y. ... I did some model-based studies of seismic waves. ... > The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)
  • Re: Trend Line / Curve
    ... MathWorks offers a couple different products to extend the basic fitting ... Curve Fitting Toolbox is specific designed to solve curve and surface ...
    (comp.soft-sys.matlab)

Loading