Skip to content

Commit

Permalink
[UPDATE] fcn desc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Mar 26, 2015
1 parent ce09439 commit 18823fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ TODO
- allow encoding to be specified?
- will affect how values are copied!
- dido for prediction, how to handle? skip over...
9.
9. check against `len < 2`!!!
- only a single data point; unless pass through (0,0), then cannot model!
10.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
*
* DESCRIPTION:
* - Computes a least squares estimator of a linear regression model having a single explanatory variable.
* - Performs a linear regression to model the relationship between an independent variable `x` and a dependent variable `y`.
*
*
* NOTES:
Expand Down Expand Up @@ -131,7 +131,7 @@ function getSlope( x, y ) {

/**
* FUNCTION: lr( x[, y[, options]] )
* Computes a least squares estimator of a linear regression model having a single explanatory variable.
* Performs a linear regression to model the relationship between an independent variable `x` and a dependent variable `y`.
*
* @param {Array|Array[]} x - independent variable array (regressor) or zipped array
* @param {Array} [y] - dependent variable array (response)
Expand Down Expand Up @@ -276,6 +276,7 @@ function lr( arr, val, options ) {
}
// [7e] Intercept and slope are unknown...
else {
// TODO: check that len > 1!!!
slope = getSlope( x, y );
yint = mean( y ) - slope*mean( x );
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "compute-linear-regression",
"version": "0.0.0",
"description": "Linear regression.",
"description": "Simple linear regression.",
"author": {
"name": "Athan Reines",
"email": "kgryte@gmail.com"
Expand Down

0 comments on commit 18823fd

Please sign in to comment.