

Subject:
Looking for a piecewise linear regression algorithm (Computer Science).
Category: Computers > Algorithms Asked by: jack_333ga List Price: $100.00 
Posted:
09 Sep 2006 17:46 PDT
Expires: 09 Oct 2006 17:46 PDT Question ID: 763789 
Hi, I looking for a piecewise linear regression algorithm that can model a set of data points, but the breakpoint is unknown. Also, the number of breakpoints is unknown, too. For example, a set of points (0, 4), (1, 6), (2, 5) (3, 100), (4, 130), (5, 120) (7, 30), (8, 40), (9, 35) Will result two breakpoint, and 3 lines of different slops. The answer to question should provide some example, so we can understand it better. I found researched related to this question, but they are a bit difficult for me to understand, and involved other advance concepts.  
 
 
 


There is no answer at this time. 

Subject:
Re: Looking for a piecewise linear regression algorithm (Computer Science).
From: berkeleychocolatega on 11 Sep 2006 13:00 PDT 
Just a suggestion that others may want to take further: The problem is to find the breaks in the different lines. Let us do this inductively. That is, suppose that we know how to breakup the points x(1),..., x(k) and we are looking at the k+1st point. Suppose further that the last group to be fitted to a line is x(i),...x(k). Then we do the following: (Assume there are at least 3 points from x(i) to x(k).) Find the least squares fit to x(i),...,x(k). Use the parameters to estimate y(k+1). There is an associated error (that is, standard deviation) with the estimate as well. If the y(k+1) is several standard deviations from this estimate, then the k+1st point is considered to be on a different line. [The formula for the error of the estimate of y(k+1) is s*sqrt(1 + 1/n + (x(k+1)xbar)^2/Sx^2 ), where s is the standard error of the fit, n is the number of points in this piece, xbar is the average x in this piece, and Sx^2 is the sum of the squares of the differences of the x's from xbar. You can look up this formula up in any good text on linear regression.] 
Subject:
Re: Looking for a piecewise linear regression algorithm (Computer Science).
From: gorillabiscuitga on 13 Sep 2006 15:09 PDT 
What would be the realworld application for this kind of stuff? 
Subject:
Re: Looking for a piecewise linear regression algorithm (Computer Science).
From: seb1984ga on 13 Sep 2006 15:31 PDT 
Ok if I understand your problem correctly it should be pretty simple. Since you are looking for a linear connection between the given points. First of all you have to calculate the slope of the lines. The formula to do this is: deltaY / deltaX = (Y2Y1) / (X2X1); So for the given points it would be: (46) / (01) = 2 Now all you have to do: Check this value. If it's to big then you got a breakpoint. C Pseudo Code { slope = (Y[NEXT]  Y[LAST]) / (X[NEXT]X[LAST]); } 
Subject:
Re: Looking for a piecewise linear regression algorithm (Computer Science).
From: seb1984ga on 13 Sep 2006 15:36 PDT 
Sorry I hit enter to fast. So the pseudo code again: C Pseudo Code { slope = (Y[NEXT]  Y[LAST]) / (X[NEXT]X[LAST]); if (abs(slope) > maximum_value) breakpoint(); } To get a good maximum_value you can use historical data, probabilities or what ever fits the situation the best. (That depends on your programm) I jope I could help you out :) If you got some questions on my answer please feel free to contact me. Thanks sebastian 
Subject:
Re: Looking for a piecewise linear regression algorithm (Computer Science).
From: jack_333ga on 15 Sep 2006 17:34 PDT 
Hi seb1994ga, can you please provided a "detailed" example please? Yeah, what you said it is a basic concept behind this, and I am looking for more advance way doing it. Thanks. 
If you feel that you have found inappropriate content, please let us know by emailing us at answerssupport@google.com with the question ID listed above. Thank you. 
Search Google Answers for 
Google Home  Answers FAQ  Terms of Service  Privacy Policy 