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.
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.
5 Comments:
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 :)
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.
So where does the data go? Wheer and how do you enter data streams in to this code to run it?
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.
I would love to see an example of how this class works...
Post a Comment
<< Home