help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you find curvature of "splattered" data?


From: Robert A. Macy
Subject: Re: How do you find curvature of "splattered" data?
Date: Mon, 13 Mar 2006 21:44:44 -0800

The noise is severe enough that the spacing between data
points along the ordinate are very obviously not evenly
spaced, and worse, where the slope gets extreme, the
ordinate is not even sequential!  

The input variable, VAR, is known and has very little noise
in it. That variable is processed through unknown functions
and produces the sets of data...
  dataX = someunknownfunctionofX(VAR);
  dataY = someunknownfunctionovY(VAR);
      not the same unknown functions.  

VAR is monotonic and has specific steps, not uniform steps,
but specific steps.  

Over any range, y and x can be extremely flat with no
slope, or can be a vertical line with infinite slope, just
depends.  

so, given 
 x = dataX
 y = dataY
the goal is to find a line that has least square error to
all the data, but looks like a polynomial fit...
 y = a + b*x + c*x*x
find a, b, and c

Using svd(cov(x,y)) worked great to find a simple line of
splattered data... 
 y = a + b*x
find a and b

That resulting line had the best mean and the best slope
for all the data.  Always worked whether the line was flat,
or vertical.  As the slope went to infinite, the results
were well behaved.  As expected, polyfit() did not work
well there.  Reversing the order, using polyfit, and using
reciprocals worked a bit but then there is a transition
between the two approaches.  

Maybe there is some way to use polyfit and the exact
variable, var1, but just don't know how to do it with those
someunknownfunctionX&Y() in there.

                - Robert -

On Mon, 13 Mar 2006 16:42:43 -0600
 Quentin Spencer <address@hidden> wrote:
> Take a look at the polyfit function and see if that's
> what you're looking for. From your description of the
> linear fit you were using, it sounds like you may have
> been using a "total least squares" fit, which I don't
> think extends easily to polynomial fitting, but you can
> at least get a standard least squares fit using polyfit.
> 
> -Quentin



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]