<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 03:42:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ian Barber's Blog: Linear Regression in PHP (part 2)]]></title>
      <guid>http://www.phpdeveloper.org/news/17015</guid>
      <link>http://www.phpdeveloper.org/news/17015</link>
      <description><![CDATA[<p>
In <a href="http://phpdeveloper.org/news/16991">a previous post</a> <i>Ian Barber</i> started looking at code you could use to determine linear regression in PHP. In <a href="http://phpir.com/linear-regression-in-php-part-2">part two</a> he restructures the code into a more manageable class rather than the mostly procedural process it was before.
</p>
<blockquote>
In the <a href="http://phpir.com/linear-regression-in-php">last post</a> we had a simple stepping algorithm, and a gradient descent implementation, for fitting a line to a set of points with one variable and one 'outcome'. As I mentioned though, it's fairly straightforward to extend that to multiple variables, and even to curves, rather than just straight lines. For this example I've reorganised the code slightly into a <a href="https://github.com/ianbarber/PHPIR/blob/master/multivagraddec.php">class</a> to make life a little easier, but the main changes are just the hypothesis and learn functions.
</blockquote>
<p>
He restructures the learning method to make it easier to reuse and includes a "scale data" method to compensate for irregularities in the data and compute the variance.
</p>]]></description>
      <pubDate>Wed, 19 Oct 2011 12:40:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ian Barber's Blog: Linear Regression in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16991</guid>
      <link>http://www.phpdeveloper.org/news/16991</link>
      <description><![CDATA[<p>
<i>Ian Barber</i> has a new post about an interesting method for determining the "line" that results follow in your statistics - <a href="http://phpir.com/linear-regression-in-php">linear regression in PHP</a> (complete with code samples).
</p>
<blockquote>
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.
</blockquote>
<p>
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 <a href="http://phpir.com/user/files/postim1/Screen%20shot%202011-10-12%20at%2011.12.06.png">these results</a>, 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.
</p>]]></description>
      <pubDate>Thu, 13 Oct 2011 12:57:09 -0500</pubDate>
    </item>
  </channel>
</rss>
