Monday, November 21, 2005

Linear Regression PHP Class

5 Comments:

At 1:11 PM, Anonymous Andras said...

Hey, Your code rocks except for Line 21, where it says $vSumXY += $x*$x; instead of $vSumXX += $x*$x; . Please correct it, it took me quite a lot of time to figure out, why the results were wrong.

Thanks anyway, I really appreciated it :)

 
At 2:55 PM, Blogger trungson said...

Correction has been made. It's weird how I have it correct in the codebase but somehow pasted it incorrectly to the blog. :) Thanks Andras.

 
At 8:46 AM, Anonymous Anonymous said...

So where does the data go? Wheer and how do you enter data streams in to this code to run it?

 
At 8:10 AM, Anonymous Anonymous said...

For those who are interested, I have compared the values of slope and Y-intercept given by this Class with those given by Excel. They produce exactly equivalent responses, at least out to 10 decimal places. Nice work.

 
At 2:42 PM, Anonymous Anonymous said...

I would love to see an example of how this class works...

 

Post a Comment

<< Home