import { default } from "https://deno.land/x/simplestatistic@v7.7.1/src/linear_regression_line.js";
Given the output of linearRegression
: an object
with m
and b
values indicating slope and intercept,
respectively, generate a line function that translates
x values into y values.
Examples
var l = linearRegressionLine(linearRegression([[0, 0], [1, 1]]));
l(0) // = 0
l(2) // = 2
linearRegressionLine({ b: 0, m: 1 })(1); // => 1
linearRegressionLine({ b: 1, m: 1 })(1); // => 2
var l = linearRegressionLine(linearRegression([[0, 0], [1, 1]])); l(0) // = 0 l(2) // = 2 linearRegressionLine({ b: 0, m: 1 })(1); // => 1 linearRegressionLine({ b: 1, m: 1 })(1); // => 2