2017 © Pedro Peláez
 

library linear-regression

PHP package for computation of simple linear regression parameters

image

mnshankar/linear-regression

PHP package for computation of simple linear regression parameters

  • Sunday, September 18, 2016
  • by mnshankar
  • Repository
  • 5 Watchers
  • 17 Stars
  • 2,385 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Build Status, (*1)

Simple Linear Regression

This package is used to compute simple linear regression parameters using PHP. It can be used to closely mimic the output of excel regression computation add-in. For a good how-to and intro if you are unfamiliar with this feature see Excel-easy's regression example., (*2)

Installation

Add the LinearRegression package as a dependency to your composer.json file:, (*3)

{
    "require": {
        "mnshankar/linear-regression": "1.0.*"
    }
}

Using the tool

The unit tests (in the tests folder) contain a wealth of information regarding the API. Basically, you load up the X and Y columns (from arrays or a CSV) and run the compute() method to generate all the regression parameters :-), (*4)

$reg = new \mnshankar\LinearRegression\Regression();
$reg->setX($this->getXForTesting());
$reg->setY($this->getYForTesting());
$reg->compute();

Note: To account for the intercept, the first element of all X arrays is forced to be 1., (*5)

Please refer to the Excel workbook named "Regression_Verification.xlsx" in the tests folder. The worksheet named "Calculated Values" contains all parameters generated by the excel add-in using data in the worksheet named "Raw Data"., (*6)

The unit tests for regression computation tests/RegressionTest.php verifies that this same data is generated by the PHP package., (*7)

The Versions

18/09 2016

dev-master

9999999-dev

PHP package for computation of simple linear regression parameters

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Shankar Manamalkav

24/02 2015

1.0

1.0.0.0

PHP package for computation of simple linear regression parameters

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Shankar Manamalkav