{"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":"2.0.0","license":"MIT","main":"./dist/regression.js","repository":{"type":"git","url":"git+https://github.com/tom-alexander/regression-js.git"},"keywords":["regression","data","fiting","modeling","analysis"],"scripts":{"clean":"rm -rf dist && mkdir dist","lint":"eslint src/** tests/**","test":"npm run lint && ./node_modules/.bin/nyc --reporter=lcov ./node_modules/.bin/mocha --compilers js:babel-core/register","build":"npm run clean && npm run build-regression-js && npm run build-regression-min-js","build-regression-js":"babel src/regression.js --out-file dist/regression.js","build-regression-min-js":"BABEL_ENV=production ./node_modules/.bin/babel src/regression.js --out-file dist/regression.min.js"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-preset-babili":"^0.1.4","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","chai":"^3.5.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.2.0","eslint-plugin-import":"^2.7.0","mocha":"^3.2.0","nyc":"^11.0.3"},"gitHead":"f905366d21ee189d6d9e9173b0f4ff99562117f3","bugs":{"url":"https://github.com/tom-alexander/regression-js/issues"},"homepage":"https://github.com/tom-alexander/regression-js#readme","_id":"regression@2.0.0","_shasum":"0f23e4012f0a4c2b5ef828b4f4b4e39f72dfb96a","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"dist":{"shasum":"0f23e4012f0a4c2b5ef828b4f4b4e39f72dfb96a","tarball":"http://registry-npm.ywwl.com/regression/download/regression-2.0.0.tgz","integrity":"sha512-ywB5WoaOYJg104hFAUW7SWyi94dsyQF7I2uS5f6ydgz5Qy/j5Q9fizrmgehKGqwmnMwL3f9jep+Fgbq2/ugJjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAm5JjzzKy8e/pxLjzxVWt2uOV7VSENLtx89rwHLSLKiAiEA4ROudQGQC1D1vd3B+J9p6oCJzYphdbqw6LNNAad5DiE="}],"size":30047,"noattachment":false,"key":"/regression/-/regression-2.0.0.tgz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regression-2.0.0.tgz_1500088072182_0.8579580299556255"},"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":1500088072611,"_cnpm_publish_time":1500088072611,"dist-tags":{"latest":"2.0.1"}}