{"name":"regression","description":"Javascript least squares data fitting methods","contributors":[{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},{"name":"Misha Wolfson","email":"misha@ginkgobioworks.com"}],"version":"1.4.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/tom-alexander/regression-js.git"},"keywords":["regression","data","fitting","modelling","analysis"],"scripts":{"test":"grunt test","build":"grunt"},"devDependencies":{"babel-eslint":"^7.1.1","eslint":"^3.12.2","eslint-config-airbnb-es5":"^1.1.0","eslint-plugin-react":"^6.8.0","grunt":"~0.4.1","grunt-contrib-uglify":"~0.2.2","grunt-eslint":"^19.0.0","grunt-mocha-test":"^0.13.2","mocha":"^3.2.0"},"gitHead":"0a97486bd5e3d7a648a1a3d59bf71441eedfda36","bugs":{"url":"https://github.com/tom-alexander/regression-js/issues"},"homepage":"https://github.com/tom-alexander/regression-js#readme","_id":"regression@1.4.0","_shasum":"d3468f9fbada1c70161df31f6c64301677ac5a70","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.1","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"dist":{"shasum":"d3468f9fbada1c70161df31f6c64301677ac5a70","tarball":"http://registry-npm.ywwl.com/regression/download/regression-1.4.0.tgz","integrity":"sha512-SJVlSi/4fQoGEKWYVDqQ9e5q4LoU8SByrHCQ6iz/350P9IPbVfPf1U5qTcpHscbKMpgBxF1hCkMUzwixLxmCug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICluxgvohgPT42y8f6DZIVQh62yjUMS2gvDL+vRqeB8xAiEA1+0hkOZMYtBm0qknjw/xtd5tCI8X0NwUIKmS7Xi3wsI="}],"size":7421,"noattachment":false,"key":"/regression/-/regression-1.4.0.tgz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/regression-1.4.0.tgz_1482094380144_0.8209839367773384"},"directories":{},"readme":"\n<div align=\"center\">\n<h1>regression-js</h1>\n<a href=\"https://travis-ci.org/Tom-Alexander/regression-js\">\n<img src=\"https://travis-ci.org/Tom-Alexander/regression-js.svg?branch=master\"/>\n</a>\n<a href=\"https://npmjs.com/package/regression\">\n<img src=\"https://img.shields.io/npm/v/regression.svg\" alt=\"npm version\" />\n</a>\n<a href=\"https://npmjs.com/package/regression\">\n<img src=\"https://img.shields.io/npm/dt/regression.svg\" alt=\"npm downloads\" />\n</a>\n<a href=\"https://codeclimate.com/github/Tom-Alexander/regression-js/coverage\"><img src=\"https://codeclimate.com/github/Tom-Alexander/regression-js/badges/coverage.svg\" /></a>\n<br/>\n<br/>\n<p>\nregression-js is a JavaScript module containing a collection of linear least-squares fitting methods for simple data analysis.\n</p>\n</div>\n\n## Installation\nThis module works on node and in the browser. It is available as the 'regression' package on [npm](https://www.npmjs.com/package/regression). It is also available on a [CDN](https://cdnjs.com/libraries/regression).\n\n### npm\n\n```\nnpm install --save regression\n```\n\n## Usage\n\n```javascript\nimport regression from 'regression';\nconst result = regression.linear([[0, 1], [32, 67], [12, 79]]);\nconst gradient = result.equation[0];\nconst yIntercept = result.equation[1];\n```\n\nData is passed into the model as an array. A second parameter can be used to configure the model. The configuration parameter is optional. `null` values are ignored. The precision option will set the number of significant figures the output is rounded to.\n\n### Configuration options\nBelow are the default values for the configuration parameter.\n```javascript\n{\n  order: 2,\n  precision: 2,\n}\n```\n\n### Properties\n- `equation`: an array containing the coefficients of the equation\n- `string`: A string representation of the equation\n- `points`: an array containing the predicted data in the domain of the input\n- `r2`: the coefficient of determination (<i>R</i><sup>2</sup>)\n- `predict(x)`: This function will return the predicted value\n\n## API\n\n### `regression.linear(data[, options])`\nFits the input data to a straight line with the equation ![y = mx + c](http://mathurl.com/ycqyhets.png). It returns the coefficients in the form `[m, c]`.\n\n### `regression.exponential(data[, options])`\nFits the input data to a exponential curve with the equation ![y = ae^bx](http://mathurl.com/zuys53z.png). It returns the coefficients in the form `[a, b]`.\n\n### `regression.logarithmic(data[, options])`\nFits the input data to a logarithmic curve with the equation ![y = a + b ln x](http://mathurl.com/zye394m.png). It returns the coefficients in the form `[a, b]`.\n\n### `regression.power(data[, options])`\nFits the input data to a power law curve with the equation ![y = ax^b](http://mathurl.com/gojkazs.png). It returns the coefficients in the form `[a, b]`.\n\n### `regression.polynomial(data[, options])`\nFits the input data to a polynomial curve with the equation ![anx^n ... + a1x + a0](http://mathurl.com/hxz543o.png). It returns the coefficients in the form `[an..., a1, a0]`. The order can be configure with the `order` option.\n\n#### Example\n\n```javascript\nconst data = [[0,1],[32, 67] .... [12, 79]];\nconst result = regression.polynomial(data, { order: 3 });\n```\n\n## Development\n\n- Install the dependencies with `npm install`\n- To build the assets in the `dist` directory, use `npm run build`\n- You can run the tests with: `npm run test`.\n","publish_time":1482094382230,"_cnpm_publish_time":1482094382230,"dist-tags":{"latest":"2.0.1"}}