MCPcopy Index your code
hub / github.com/microsoft/SandDance / ols

Function ols

docs/app/js/sanddance-app.js:119627–119633  ·  view source on GitHub ↗
(uX, uY, uXY, uX2)

Source from the content-addressed store, hash-verified

119625}
119626// Ordinary Least Squares
119627function ols(uX, uY, uXY, uX2) {
119628 const delta = uX2 - uX * uX, slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta, intercept = uY - slope * uX;
119629 return [
119630 intercept,
119631 slope
119632 ];
119633}
119634function points(data, x, y, sort) {
119635 data = data.filter((d)=>{
119636 let u = x(d), v = y(d);

Callers 5

linearFunction · 0.70
logFunction · 0.70
expFunction · 0.70
powFunction · 0.70
loessFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected