Re: How to get the equation of a curve fitting experimental data?
- From: John D'Errico <woodchips@xxxxxxxxxxxxxxxx>
- Date: Wed, 04 Jan 2006 18:26:59 GMT
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
.
- Follow-Ups:
- Re: How to get the equation of a curve fitting experimental data?
- From: Rune Allnor
- Re: How to get the equation of a curve fitting experimental data?
- References:
- Prev by Date: xlswrite function in R12
- Next by Date: Re: How to write a complete window to a graphics file?
- Previous by thread: Re: How to get the equation of a curve fitting experimental data?
- Next by thread: Re: How to get the equation of a curve fitting experimental data?
- Index(es):
Relevant Pages
|
Loading