News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ian Barber's Blog:
Linear Regression in PHP
October 13, 2011 @ 12:57:09

Ian Barber has a new post about an interesting method for determining the "line" that results follow in your statistics - linear regression in PHP (complete with code samples).

There are a lot of problems that fall under predicting these types of continuous values based on limited inputs - for example: given the air pressure, how much rain will there be, given the qualifying times, how quick will the fastest lap be in the race. By taking a bunch of existing data and fitting a line, we will be able to make a prediction easily - and often reasonably correctly.

He defines two pieces of information, the intercept and the gradient, and how they relate to minimize the "square error" that can come from getting the square root of your values based on the difference between an actual and predicted value. Based on a sample data set, he comes up with these results, showing the trend line for the points given. He points out a few issues with the method and corrects them with a few tweaks to his original algorithm.

0 comments voice your opinion now!
linear regression algorithm square error


blog comments powered by Disqus

Similar Posts

Kevin van Zonneveld: It's Almost 2014 and We Are Still Committing Broken Code

Lorna Mitchell's Blog: Invalid Protected Resource URL in pecl_oauth

Stefan Koopmanschap's Blog: Your error page can be better

Christopher Kunz's Blog: Building PHP with cURL and libmysqlclient5

Gonzalo Ayuso's Blog: Display errors on screen even with display errors = off with PHP


Community Events











Don't see your event here?
Let us know!


series component language introduction opinion security install hack release symfony2 facebook code unittest podcast threedevsandamaybe framework composer hhvm application package

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework