{"name":"regression","description":"Javascript least squares data fitting methods","author":{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},"version":"1.2.0","license":"MIT","repository":{"type":"git","url":"git://github.com/Tom-Alexander/regression-js"},"keywords":["regression","data","fitting","modelling","analysis"],"devDependencies":{"grunt":"~0.4.1","grunt-contrib-uglify":"~0.2.2"},"gitHead":"9961bb266aa8d9ff0a50d63bbc4af879c8ba60b3","bugs":{"url":"https://github.com/Tom-Alexander/regression-js/issues"},"homepage":"https://github.com/Tom-Alexander/regression-js","_id":"regression@1.2.0","scripts":{},"_shasum":"3e6a1b8f6a34990cff9f3369a55327ddb0755f43","_from":"./","_npmVersion":"1.4.14","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"dist":{"shasum":"3e6a1b8f6a34990cff9f3369a55327ddb0755f43","tarball":"http://registry-npm.ywwl.com/regression/download/regression-1.2.0.tgz","integrity":"sha512-OZWCKhg5aa5M+86GEbO+UrCwmrOcmfUFBuHsBoHnJEzDgvT8SFyjr/B9snMKHTdPOl9H/lj46UDOY9TxrbImng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdoVAm5pIB5KqrQu+j8wSgOrkJm0392Zk1/Y247kWsEwIgbLOSRPA3pxUB9LkI3GWaeC3Xu5UCf9jLjRYDb17sxR0="}],"size":8017,"noattachment":false,"key":"/regression/-/regression-1.2.0.tgz"},"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":1405596266309,"_cnpm_publish_time":1405596266309,"dist-tags":{"latest":"2.0.1"}}