{
  "_id": "regression",
  "maintainers": [
    {
      "name": "tom-alexander",
      "email": "me@tomalexander.co.nz"
    }
  ],
  "keywords": [
    "regression",
    "data",
    "fiting",
    "modeling",
    "analysis"
  ],
  "dist-tags": {
    "latest": "2.0.1"
  },
  "author": {
    "name": "Tom Alexander",
    "email": "me@tomalexander.co.nz"
  },
  "_rev": "16-3e5299005b255bd2127c271d7411bdaa",
  "description": "Javascript least squares data fitting methods",
  "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",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/tom-alexander/regression-js.git"
  },
  "users": {
    "parkerproject": true,
    "cmpolis": true,
    "mastayoda": true,
    "tobitobitobi": true,
    "mysticatea": true,
    "binarymax": true,
    "3xl": true,
    "mimmo1": true
  },
  "bugs": {
    "url": "https://github.com/tom-alexander/regression-js/issues"
  },
  "license": "MIT",
  "versions": {
    "1.2.0": {
      "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": "https://archive.ito.gov.ir/npm/_packages/regression/-/regression-1.2.0.tgz",
        "integrity": "sha512-OZWCKhg5aa5M+86GEbO+UrCwmrOcmfUFBuHsBoHnJEzDgvT8SFyjr/B9snMKHTdPOl9H/lj46UDOY9TxrbImng==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQDdoVAm5pIB5KqrQu+j8wSgOrkJm0392Zk1/Y247kWsEwIgbLOSRPA3pxUB9LkI3GWaeC3Xu5UCf9jLjRYDb17sxR0="
          }
        ]
      }
    },
    "1.2.1": {
      "name": "regression",
      "description": "Javascript least squares data fitting methods",
      "author": {
        "name": "Tom Alexander",
        "email": "me@tomalexander.co.nz"
      },
      "version": "1.2.1",
      "license": "MIT",
      "repository": {
        "type": "git",
        "url": "https://github.com/Tom-Alexander/regression-js"
      },
      "keywords": [
        "regression",
        "data",
        "fitting",
        "modelling",
        "analysis"
      ],
      "devDependencies": {
        "grunt": "~0.4.1",
        "grunt-contrib-uglify": "~0.2.2"
      },
      "gitHead": "ae4596905e0be4c092e5625fb21e84840ad1e4f1",
      "bugs": {
        "url": "https://github.com/Tom-Alexander/regression-js/issues"
      },
      "homepage": "https://github.com/Tom-Alexander/regression-js",
      "_id": "regression@1.2.1",
      "scripts": {},
      "_shasum": "d4e96c0341adb38130903b8ae2f9dced905d606d",
      "_from": ".",
      "_npmVersion": "2.7.4",
      "_nodeVersion": "0.12.2",
      "_npmUser": {
        "name": "tom-alexander",
        "email": "me@tomalexander.co.nz"
      },
      "maintainers": [
        {
          "name": "tom-alexander",
          "email": "me@tomalexander.co.nz"
        }
      ],
      "dist": {
        "shasum": "d4e96c0341adb38130903b8ae2f9dced905d606d",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/regression/-/regression-1.2.1.tgz",
        "integrity": "sha512-puyf84cwe+P9EXIYhKy/H8TqKNLou7/YYZj8nd3/UTGfwwzITVtxioOM0ihfpPCMZt5rHRWZJqif820s92d1vw==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQDT7r8xC5w+qJfeSpkV9egHch5E2VhlJpgSMh8fs29iZQIgHuZEXJ9bFlHWRqkv5N1UU/OIQx4JwAHvWb/cqGKeqTA="
          }
        ]
      }
    },
    "1.4.0": {
      "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": "https://archive.ito.gov.ir/npm/_packages/regression/-/regression-1.4.0.tgz",
        "integrity": "sha512-SJVlSi/4fQoGEKWYVDqQ9e5q4LoU8SByrHCQ6iz/350P9IPbVfPf1U5qTcpHscbKMpgBxF1hCkMUzwixLxmCug==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCICluxgvohgPT42y8f6DZIVQh62yjUMS2gvDL+vRqeB8xAiEA1+0hkOZMYtBm0qknjw/xtd5tCI8X0NwUIKmS7Xi3wsI="
          }
        ]
      },
      "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"
      }
    },
    "2.0.0": {
      "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": "https://archive.ito.gov.ir/npm/_packages/regression/-/regression-2.0.0.tgz",
        "integrity": "sha512-ywB5WoaOYJg104hFAUW7SWyi94dsyQF7I2uS5f6ydgz5Qy/j5Q9fizrmgehKGqwmnMwL3f9jep+Fgbq2/ugJjQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIAm5JjzzKy8e/pxLjzxVWt2uOV7VSENLtx89rwHLSLKiAiEA4ROudQGQC1D1vd3B+J9p6oCJzYphdbqw6LNNAad5DiE="
          }
        ]
      },
      "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"
      }
    },
    "2.0.1": {
      "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.1",
      "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_ENV=production ./node_modules/.bin/babel src/regression.js --out-file dist/regression.js",
        "build-regression-min-js": " ./node_modules/.bin/uglifyjs dist/regression.js --output 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-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",
        "uglify-js": "3"
      },
      "author": {
        "name": "Tom Alexander",
        "email": "me@tomalexander.co.nz"
      },
      "gitHead": "7995fd9955ca23a8a99834a9f28aa9c8adc7ad19",
      "bugs": {
        "url": "https://github.com/tom-alexander/regression-js/issues"
      },
      "homepage": "https://github.com/tom-alexander/regression-js#readme",
      "_id": "regression@2.0.1",
      "_shasum": "8d29c3e8224a10850c35e337e85a8b2fac3b0c87",
      "_from": ".",
      "_npmVersion": "4.1.2",
      "_nodeVersion": "7.5.0",
      "_npmUser": {
        "name": "tom-alexander",
        "email": "me@tomalexander.co.nz"
      },
      "dist": {
        "shasum": "8d29c3e8224a10850c35e337e85a8b2fac3b0c87",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/regression/-/regression-2.0.1.tgz",
        "integrity": "sha512-A4XYsc37dsBaNOgEjkJKzfJlE394IMmUPlI/p3TTI9u3T+2a+eox5Pr/CPUqF0eszeWZJPAc6QkroAhuUpWDJQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIE9zPyCFrFqxTQ27jZcjpOFXJNrfW8LBffUk5BOwoxJjAiAYP12ZyAdcdjYVhzzRRC9vEW0SJ0kR5KRDcEDMjhWuLw=="
          }
        ]
      },
      "maintainers": [
        {
          "name": "tom-alexander",
          "email": "me@tomalexander.co.nz"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/regression-2.0.1.tgz_1512903316533_0.44972028816118836"
      }
    }
  },
  "name": "regression",
  "time": {
    "modified": "2026-05-20T19:27:34.740Z",
    "created": "2014-07-17T11:24:26.309Z",
    "1.2.0": "2014-07-17T11:24:26.309Z",
    "1.2.1": "2015-05-05T23:58:59.944Z",
    "1.4.0": "2016-12-18T20:53:02.230Z",
    "2.0.0": "2017-07-15T03:07:52.611Z",
    "2.0.1": "2017-12-10T10:55:16.642Z"
  },
  "readmeFilename": "README.md",
  "contributors": [
    {
      "name": "Tom Alexander",
      "email": "me@tomalexander.co.nz"
    },
    {
      "name": "Misha Wolfson",
      "email": "misha@ginkgobioworks.com"
    }
  ],
  "homepage": "https://github.com/tom-alexander/regression-js#readme"
}