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

Function Bs

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

Source from the content-addressed store, hash-verified

4803 return { coef: u, predict: l, rSquared: Ss(t, e, n, i, l) };
4804 }
4805 function Bs(t, e, n) {
4806 const [r, i, o, a] = Cs(t, e, n);
4807 let s,
4808 u,
4809 l,
4810 c = 0,
4811 f = 0,
4812 h = 0,
4813 d = 0,
4814 p = 0;
4815 Fs(t, e, n, (t, e) => {
4816 ((s = r[p++]),
4817 (u = Math.log(e)),
4818 (l = s * e),
4819 (c += (e * u - c) / p),
4820 (f += (l - f) / p),
4821 (h += (l * u - h) / p),
4822 (d += (s * l - d) / p));
4823 });
4824 const [g, m] = Ds(f / a, c / a, h / a, d / a),
4825 y = (t) => Math.exp(g + m * (t - o));
4826 return {
4827 coef: [Math.exp(g - m * o), m],
4828 predict: y,
4829 rSquared: Ss(t, e, n, a, y),
4830 };
4831 }
4832 function zs(t, e, n) {
4833 let r = 0,
4834 i = 0,

Callers

nothing calls this directly

Calls 4

CsFunction · 0.85
FsFunction · 0.85
DsFunction · 0.85
SsFunction · 0.85

Tested by

no test coverage detected