{"id":18616024,"url":"https://github.com/bjoern-hempel/js-regression-framework","last_synced_at":"2025-11-03T05:30:22.193Z","repository":{"id":110076522,"uuid":"145624259","full_name":"bjoern-hempel/js-regression-framework","owner":"bjoern-hempel","description":" This is a javascript regression framework.","archived":false,"fork":false,"pushed_at":"2018-11-07T22:54:13.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T03:13:17.275Z","etag":null,"topics":["javascript","linear-regression","mathematics","mit-license","regression","regression-algorithms","regression-analysis","statistics"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjoern-hempel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-21T22:05:15.000Z","updated_at":"2018-11-07T22:54:14.000Z","dependencies_parsed_at":"2023-04-01T15:49:47.733Z","dependency_job_id":null,"html_url":"https://github.com/bjoern-hempel/js-regression-framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fjs-regression-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fjs-regression-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fjs-regression-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fjs-regression-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjoern-hempel","download_url":"https://codeload.github.com/bjoern-hempel/js-regression-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412487,"owners_count":19634016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","linear-regression","mathematics","mit-license","regression","regression-algorithms","regression-analysis","statistics"],"created_at":"2024-11-07T03:33:49.480Z","updated_at":"2025-11-03T05:30:22.127Z","avatar_url":"https://github.com/bjoern-hempel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Javascript regression framework\n\nThis is a javascript regression analysis framework.\n\n\n## 0. Introduction\n\nRegression analysis is a statistical analysis technique that aims to model relationships between a dependent variable and one or more independent variables.\n\n\n## 1. Linear regression (2D)\n\nLinear regression, which is a special case of the general concept of regression analysis, is a statistical technique that attempts to explain an observed dependent variable by one or more independent variables.\n\n\n### 1.1 Preliminary considerations\n\n#### 1.1.1 Calculation of the slope m\n\n\u003cimg src=\"https://latex.ixno.de/?r=300\u0026p=1pt\u0026c=1\u0026f=m%20%3D%20%5Cfrac%7B%5Csum_%7Bi%3D1%7D%5En%28x_i-%5Coverline%7Bx%7D%29%28y_i-%5Coverline%7By%7D%29%7D%7B%5Csum_%7Bi%3D1%7D%5En%28x_i-%5Coverline%7Bx%7D%29%5E2%7D\" width=\"253\" alt=\"m = \\frac{\\sum_{i=1}^n(x_i-\\overline{x})(y_i-\\overline{y})}{\\sum_{i=1}^n(x_i-\\overline{x})^2}\"\u003e\n\n#### 1.1.2 Calculation of the intercept b\n\n\u003cimg src=\"https://latex.ixno.de/?r=300\u0026p=1pt\u0026c=1\u0026f=b%20%3D%20%5Coverline%7By%7D-m%20%5Ccdot%20%5Coverline%7Bx%7D\" width=\"129\" alt=\"b = \\overline{y}-m \\cdot \\overline{x}\"\u003e\n\n#### 1.1.3 Calculation of the scope R\u003csup\u003e2\u003c/sup\u003e\n\n\u003cimg src=\"https://latex.ixno.de/?r=300\u0026p=1pt\u0026c=1\u0026f=R%5E2%20%3D%201%20-%20%5Cfrac%7B%5Csum_%7Bi%3D1%7D%5En%28y_i-%5Chat%7By%7D_i%29%5E2%7D%7B%5Csum_%7Bi%3D1%7D%5En%28y_i-%5Coverline%7By%7D%29%5E2%7D\" width=\"239\" alt=\"R^2 = 1 - \\frac{\\sum_{i=1}^n(y_i-\\hat{y}_i)^2}{\\sum_{i=1}^n(y_i-\\overline{y})^2}\"\u003e\n\n### 1.2 Usage\n\nLinear regression in 2-dimensional space, which is a special case of the general concept of regression analysis, is a statistical method that attempts to explain an observed dependent variable by one or more independent variables.\n\n```javascript\nvar regression = Regression.linear();\n\nregression.addRecord(20,  0);\nregression.addRecord(16,  3);\nregression.addRecord(15,  7);\nregression.addRecord(16,  4);\nregression.addRecord(13,  6);\nregression.addRecord(10, 10);\n\nvar mn = regression.calculate();\n\nconsole.log(String('y(x) = %s * x + %s').replace(/%s/, mn.m).replace(/%s/, mn.n));\n```\n\n**It returns:**\n\n```javascript\ny(x) = -0.9821428571428571 * x + 19.732142857142854\n```\n\n\n## A. Authors\n\n* Björn Hempel \u003cbjoern@hempel.li\u003e - _Initial work_ - [https://github.com/bjoern-hempel](https://github.com/bjoern-hempel)\n\n\n## B. Licence\n\nThis tutorial is licensed under the MIT License - see the [LICENSE.md](/LICENSE.md) file for details\n\n\n## C. Closing words\n\nHave fun! :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoern-hempel%2Fjs-regression-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjoern-hempel%2Fjs-regression-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoern-hempel%2Fjs-regression-framework/lists"}