help-octave
[Top][All Lists]
Advanced

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

Re: test a cloud of 2D points for linearity


From: Georg P. Israel
Subject: Re: test a cloud of 2D points for linearity
Date: Wed, 27 May 2009 18:02:21 +0200

Dear Joshua,

it might that I miss understand the polyfit function.

I had the impression that this will fit a simple polynom of y=a+b*x into
the cloud of points.
This will work OK if the cloud has a horizontal shape.
Then "b" -> 0 . In this case, the root mean square of the cloud is
computed correctly with there orthogonal distance to the line.

But now, consider that the cloud of points gets rotated by 90 degree.
In this case, the
"b" -> infinity.
Even worse, the root mean square (RMS) distance of the cloud points to
the line is now not computed with there orthogonal distance!!

Hence, the RMS distance of the cloud points to the line will depend very
much on the angle of the line.

Now, I need something that fits a line trough the cloud of points and
then computes the orthogonal root means square distance of the cloud
points from the line.

Best regards

Georg P. Israel




On Wed, 2009-05-27 at 11:30 -0400, Joshua Stults wrote:
> Probably
> 
> [P, S] = polyfit(x, y, 1)
> 
> will do what you want.  The second output argument gives lots of
> useful diagnostic info on the fit; also check out polyval().
> 
> On Wed, May 27, 2009 at 10:56 AM, Georg P. Israel <address@hidden> wrote:
> > Dear all,
> >
> > I am almost ashamed to ask this stupid question,
> > but with all this wealth of function, i seem to not find the right
> > stuff. Even thought, I know that it is there, probably just under my
> > nose.
> >
> > here my problem:
> >
> > I have a number of points in a plain (2D points)
> > This points can have an arbitrary distribution.
> > I would like to have a function that will fit the line through this
> > cloud of points.
> >
> > I expect that one point of this line is the mean of all points plus some
> > direction vector.
> >
> > The next thing that I like to have now is the RMS of all the distances
> > of the points along this line. This is basically a variance as seen
> > along this line.
> >
> > Now, I can certainly start to clumsily develop this function, but I am
> > sure that I am just overlooking the right function.
> >
> > Hence,
> > please point my nose this this function ...
> >
> > Best regards
> >
> > Georg P. Israel
> >
> >
> >
> > _______________________________________________
> > Help-octave mailing list
> > address@hidden
> > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> >
> 
> 
> 



reply via email to

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