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

Function ps

resources/vega.min.js:4552–4582  ·  view source on GitHub ↗
(e, n)

Source from the content-addressed store, hash-verified

4550 return i.mean(t).stdev(e);
4551 }
4552 function ps(e, n) {
4553 const r = ds();
4554 let i = 0;
4555 const o = {
4556 data(t) {
4557 return arguments.length
4558 ? ((e = t), (i = t ? t.length : 0), o.bandwidth(n))
4559 : e;
4560 },
4561 bandwidth(t) {
4562 return arguments.length ? (!(n = t) && e && (n = ns(e)), o) : n;
4563 },
4564 sample: () => e[~~(t.random() * i)] + n * r.sample(),
4565 pdf(t) {
4566 let o = 0,
4567 a = 0;
4568 for (; a < i; ++a) o += r.pdf((t - e[a]) / n);
4569 return o / n / i;
4570 },
4571 cdf(t) {
4572 let o = 0,
4573 a = 0;
4574 for (; a < i; ++a) o += r.cdf((t - e[a]) / n);
4575 return o / i;
4576 },
4577 icdf() {
4578 throw Error("KDE icdf not supported.");
4579 },
4580 };
4581 return o.data(e);
4582 }
4583 function gs(t, e) {
4584 return ((t = t || 0), (e = null == e ? 1 : e), Math.exp(t + ls() * e));
4585 }

Callers 1

transformFunction · 0.70

Calls 2

dataMethod · 0.80
dsFunction · 0.70

Tested by

no test coverage detected