diff --git a/README.md b/README.md index 64da73c..5d9c611 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,17 @@ Returns a line represented as an array of two points, where each point is an arr Also returns properties a and b, representing the equation's coefficients, and rSquared, representing the coefficient of determination. Lastly, returns a predict property, which is a function that outputs a y-coordinate given an input x-coordinate. +```js +[ + 0: [x1, x2], + 1: [y1, y2], + 2: a, + 3: b, + 4: rSquared, + 5: predict +] +``` + # linear.x([x]) · [Source](https://github.com/harrystevens/d3-regression/blob/master/src/linear.js#L47 "Source") If x is specified, sets the x-coordinate accessor, which is passed passed the current datum (d), the current index (i), and the entire data array (data). If x is not specified, returns the current x-coordinate accessor, which defaults to: @@ -229,4 +240,4 @@ See [linear.y()](#linear_y). # loess.bandwidth([bandwidth]) · [Source](https://github.com/harrystevens/d3-regression/blob/master/src/loess.js#L77 "Source") -If bandwidth is specified, sets the LOESS regression's bandwidth, or smoothing parameter, to the specific number between 0 and 1. The bandwidth represents the share of the total data points that are used to calculate each local fit. Higher bandwidths produce smoother lines, and vice versa. If bandwidth is not specified, returns a copy of the regression generator’s current bandwidth, which defaults to .3. \ No newline at end of file +If bandwidth is specified, sets the LOESS regression's bandwidth, or smoothing parameter, to the specific number between 0 and 1. The bandwidth represents the share of the total data points that are used to calculate each local fit. Higher bandwidths produce smoother lines, and vice versa. If bandwidth is not specified, returns a copy of the regression generator’s current bandwidth, which defaults to .3.