Re: spline interpolation and



John D'Errico wrote:


Frode wrote:

I use an apllication called Praat to extract pitch and energy
contours speech samples. The pitch points are extracted every
0.01
seconds. Export the data into matlab and use spline toolbox for
smooting cubic spile. The command was csaps, have tried other
methods
to "fit" the data but this seems go give me a great
approximation
of
the points.

What i meant was that when i reproduce the plot with my
original
data
with plot-command matlab draw lines betwen the points and my
cubic
spline seems to match this with a few exception. I dont think i
can
call this graph "the real" graph. Anyway, i have posted 2
pictures
to
watch then interpolation. Just look at the upper plots, thats
the
data. the circles are my points and the dots are lines
connecting
the. The other are the spline.

Would be grateful for some help for how to measure some error
or
justify this method due to some measures.
link to plots:

<http://www.stromhaug.no/pics/>

Thank you. That helps greatly to understand
what you are doing, especially the plot.

Csaps is a good tool for the approximation
of an underlying functional model from
possibly noisy data points when you don't
know of a good model for your data. Perhaps
I should start by explaining something about
splines and what they represent.

A cubic spline is what I like to call a
metaphorical model. Its a play on words,
but one that makes sense.

Metaphor: "A figure of speech in which
two things are compared by saying one
thing is another." www.educationoasis.com

A cubic spline is actually a mathematical
model of a thin flexible beam, constrained
to pass through a set of points. It is
that curve which has a minimal energy of
bending. Over the years, people (shipwrights,
draftsmen, woodworkers, engineers, etc.)
have found that such a beam generally
produces a nice smooth curve that is
often visually appealing.

A cubic smoothing spline is a variant of
the standard interpolating spline, where
the spline is now allowed to miss the data
points. We minimize a slightly modified
energy functional, that includes both
the bending energy of the flexible "beam"
as well as how well the spline fits the
data.

You will notice here that I've never
really justified the use of a spline for
ANY specific curve fitting problem. There
is no explicit reason how you can justify
the use of a cubic spline to model any
data that is not derived from a thin
flexible beam. On the other hand, splines
are tremendously valuable in a variety
of contexts. They provide a nice smooth
functional relationship that can be fit
easily to many datasets.

The "error" between the spline and your
data is composed of both any noise in
the data and something normally called
"lack-of-fit". Lack-of-fit is difficult
to quantify, since it represents the
extent that the spline model cannot
truly represent the true underlying
functional relationship in your data.

There is no reason why you cannot use
standard measures of quality of fit,
such as RMSE (root-mean-squared-error)
or R^2 if you wish to compare one fit
to another. Personally, I prefer to use
my eyes. If the spline model makes my
eyes happy, replicating the expected
shape of my curve, then the fit is good.
Its generally all I need.

Feel free to ask again if I can be of
more help.

HTH,
John

Thank you for a deep explanation :)

One last question about doing some(not eye visual) error
computations (visually it seems very good):

The only thing i know about my data are my points , right, i do not
know much about the in between space.
The solution i see is to compare my 'points' to the spline at those
points. Does that sound correct ?
.



Relevant Pages

  • Re: spline interpolation and
    ... I use an apllication called Praat to extract pitch and energy ... to "fit" the data but this seems go give me a great approximation ... spline seems to match this with a few exception. ... A cubic spline is actually a mathematical ...
    (comp.soft-sys.matlab)
  • Re: Smoothing Spline Algorithm
    ... algorithm to compute a smoothing spline. ... the idea is to minimize the total energy of ...
    (sci.math)
  • Re: Optimization Problem
    ... > I'd like to fit data to, for lack of a better way of describing it, two ... > straight line, and on an adjacent interval, it is fit by a second ... I prefer not to define a spline using this formulation, ... % Here is the objective for lsqnonlin. ...
    (comp.soft-sys.matlab)
  • Re: Broach for motorcycle gear/brake splined shafts?
    ... If you fail to locate a ready-made broach, ... Turn the end of the splined shaft down to form a pilot at the ... minor diameter of the spline. ... It's a rubber-hammer press fit. ...
    (rec.crafts.metalworking)
  • Re: Interpolation : value at endpoint.
    ... beam, forced to pass through a set of fixed points. ... The name spline itself goes back to this same thin ... The traditional cubic spline is a C2 ... knot and the penultimate knot, ...
    (comp.soft-sys.matlab)

Loading