MCPcopy Create free account
hub / github.com/alignoth/alignoth / Ns

Function Ns

resources/vega.min.js:4856–4888  ·  view source on GitHub ↗
(t, e, n)

Source from the content-addressed store, hash-verified

4854 );
4855 }
4856 function Ns(t, e, n) {
4857 const [r, i, o, a] = Cs(t, e, n),
4858 s = r.length;
4859 let u,
4860 l,
4861 c,
4862 f,
4863 h = 0,
4864 d = 0,
4865 p = 0,
4866 g = 0,
4867 m = 0;
4868 for (u = 0; u < s; )
4869 ((l = r[u]),
4870 (c = i[u++]),
4871 (f = l * l),
4872 (h += (f - h) / u),
4873 (d += (f * l - d) / u),
4874 (p += (f * f - p) / u),
4875 (g += (l * c - g) / u),
4876 (m += (f * c - m) / u));
4877 const y = p - h * h,
4878 v = h * y - d * d,
4879 _ = (m * h - g * d) / v,
4880 x = (g * y - m * d) / v,
4881 b = -_ * h,
4882 w = (t) => _ * (t -= o) * t + x * t + b + a;
4883 return {
4884 coef: [b - x * o + _ * o * o + a, x - 2 * _ * o, _],
4885 predict: w,
4886 rSquared: Ss(t, e, n, a, w),
4887 };
4888 }
4889 function Os(t, e, n, r) {
4890 if (0 === r) return Es(t, e, n);
4891 if (1 === r) return $s(t, e, n);

Callers 1

OsFunction · 0.70

Calls 2

CsFunction · 0.85
SsFunction · 0.85

Tested by

no test coverage detected