Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Non-polynomial Curve Fit problem

0 views
Skip to first unread message

lan

unread,
Apr 16, 2009, 2:36:01 PM4/16/09
to
Below is my figure data:

x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0];
plot(x,y,'ro-');
grid;
axis equal;

I have tried the polyfit but not successful, which changed my data order firstly.
I want to make a curve fit which can keep the shape of the path in above figure. Especially in the right side where there is a ear or shoulder shape.

Thanks,

lan

unread,
Apr 16, 2009, 2:42:02 PM4/16/09
to
Below is my figure data:

x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0];
plot(x,y,'ro-');
grid;
axis equal;

I want to make a curve fit which can keep the shape of the path of the figure above, especially in the right side where there is a ear or shoulder shape.

Thanks

someone

unread,
Apr 16, 2009, 2:57:01 PM4/16/09
to
"lan " <amoyj...@hotmail.com> wrote in message <gs7tqh$3oc$1...@fred.mathworks.com>...

You might download and try EzyFit from the MATLAB FEX at:

http://www.mathworks.com/matlabcentral/fileexchange/10176

You will still have to make some guess as to the type of equation you want to fit to.

What type of equation will give you the "ear or shoulder shape" you want?
Think about it!

John D'Errico

unread,
Apr 16, 2009, 4:07:02 PM4/16/09
to
"lan " <amoyj...@hotmail.com> wrote in message <gs7tqh$3oc$1...@fred.mathworks.com>...

I would suggest a simple model:

yhat = mean(y)

John

lan

unread,
Apr 16, 2009, 4:25:05 PM4/16/09
to
John:

What is the idea of your simple model. I can not follow it. Thanks,

lan

unread,
Apr 16, 2009, 4:37:01 PM4/16/09
to
I just find 'cscvn' may help to this problem. //"Natural" or periodic interpolating cubic spline curve. Though it is not the curve fit.

x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0]';
plot(x,y,'ro-');
grid;
axis equal;

figure;
p=[x' ; y'];
fnplt(cscvn(p));
grid;

John D'Errico

unread,
Apr 16, 2009, 5:09:01 PM4/16/09
to
"lan " <amoyj...@hotmail.com> wrote in message <gs8471$b8v$1...@fred.mathworks.com>...

> John:
>
> What is the idea of your simple model. I can not follow it. Thanks,

A polynomial fit for this data is simply fatuous.
I'm sorry, but it would be ridiculous in the
extreme. Just to throw random data into a
computer and expecting anything sensible to
come out, with no further input from the
scientist, analyst, or other knowledgeable
person?

You have no model for the curve, nor have you
expressed any indication that there should be a
model, mechanistic or not, for this data. It is
apparently not much more than a random walk.
The best predictor for such a random process is
probably just the mean of the data. Certainly so
if you have no other information to provide.

john

Predictor

unread,
Apr 23, 2009, 9:01:59 AM4/23/09
to
On Apr 16, 2:36 pm, "lan " <amoyjia...@hotmail.com> wrote:
> Below is my figure data:
>
> x=[-28.87 -27.35 -18.67 -22.42 -34.53 -52.73 -60.72 -68.06 -87.41 -94.16]';
> y=[-11.56 -5.57 3.26 7.15 7.69 5.82 7.99 10.45 2.70 0];
> plot(x,y,'ro-');
> grid;
> axis equal;
>
> I have tried the polyfit but not successful, which changed my data order firstly.
> I want to make acurve fitwhich can keep the shape of the path in above figure. Especially in the right side where there is a ear or shoulder shape.

Is 'y' a function of 'x'? The order of the points seems to suggest
otherwise.


-Will Dwinnell
http://matlabdatamining.blogspot.com/

0 new messages