Results 1 to 2 of 2

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

  1. #1
    Mar 2011

    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 $\displaystyle 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]: $\displaystyle ax + by + c = 0$
    For [x6, y6] through [x9, y9]:$\displaystyle a'x + b'y + c' = 0$
    For [x10, y10] through [x12, y12]: $\displaystyle 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$\displaystyle 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
    Jun 2010
    CT, USA
    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: Oct 17th 2011, 08:27 PM
  2. Please help point out the error
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: Jul 28th 2010, 12:26 PM
  3. Replies: 1
    Last Post: Dec 10th 2009, 10:48 PM
  4. Replies: 0
    Last Post: Apr 1st 2009, 04:22 AM
  5. Fixed point method : where is my error?
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 24th 2008, 11:34 AM

Search Tags

/mathhelpforum @mathhelpforum