Results 1 to 2 of 2

Math Help - best fit, minimizing point-to-line error, not y error

  1. #1
    Newbie
    Joined
    Mar 2011
    Posts
    1

    best fit, minimizing point-to-line error, not y error

    I have a set of [x, y] points that trend in a path, and I would like to find piece-wise equations to model the entire path.

    What I am thinking of doing is:

    1) Order the points, based on proximity to one another, so that I have an ordered set [x0, y0] ... [xn, yn]
    2) Find contiguous subsets of points that can be modeled by the equation ax + by + c = 0. I would start a new piecewise set when the average deviation from the line becomes too high.

    I might end up with:
    For [x0, y0] through [x5, y5]: ax +  by + c = 0
    For [x6, y6] through [x9, y9]:  a'x + b'y + c' = 0
    For [x10, y10] through [x12, y12]: a''x + b''y + c'' = 0

    ... More piecewise functions until I reach [xn, yn]

    Anyway, I'm not sure how to use least squares or something like it to solve for a, b, and c. As I've seen it done, least squares just solves for  f(x) = y = ax + b, but I want to be able to have lines that are potentially vertical and never intersect the y axis. I don't want to minimize the y-distance error. I want to minimize the point-to-line distance.

    Thanks for any ideas
    Follow Math Help Forum on Facebook and Google+

  2. #2
    A Plied Mathematician
    Joined
    Jun 2010
    From
    CT, USA
    Posts
    6,318
    Thanks
    4
    Awards
    2
    This link will help you with the perpendicular regression part. The rest of your problem appears to me to be clever programming.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. help with floating point error
    Posted in the Math Topics Forum
    Replies: 0
    Last Post: October 17th 2011, 09:27 PM
  2. Please help point out the error
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: July 28th 2010, 01:26 PM
  3. Replies: 1
    Last Post: December 10th 2009, 11:48 PM
  4. Replies: 0
    Last Post: April 1st 2009, 05:22 AM
  5. Fixed point method : where is my error?
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 24th 2008, 12:34 PM

Search Tags


/mathhelpforum @mathhelpforum