How to use the jstat.normal function in jstat

To help you get started, we’ve selected a few jstat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zhilu-nanjing / financial-cell / src / calc / expression_fn / lib / statistical.js View on Github external
exports.NORM.DIST = function(x, mean, sd, cumulative) {
  cumulative = parseBool(cumulative)
  x = parseNumber(x);
  mean = parseNumber(mean);
  sd = parseNumber(sd);
  if (anyIsError(x, mean, sd)) {
    return Error(ERROR_VALUE);
  }
  if (sd <= 0) {
    return Error(ERROR_NUM);
  }

  // Return normal distribution computed by jStat [http://jstat.org]
  return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);
};
github zhilu-nanjing / financial-cell / src / calc / expression_fn / lib / statistical.js View on Github external
export function GAUSS(z) {
  z = parseNumber(z);
  if (z instanceof Error) {
    return z;
  }
  return jStat.normal.cdf(z, 0, 1) - 0.5;
};
github TwoRavens / TwoRavens / assets / app / views / ForceDiagram.js View on Github external
    .map((_, i) => ({id: i, x: jStat.normal.sample(0, 1), y: jStat.normal.sample(0, 1)}));
github zhilu-nanjing / financial-cell / src / calc / expression_fn / lib / statistical.js View on Github external
exports.NORM.S.INV = function(probability) {
  probability = parseNumber(probability);
  if (probability instanceof Error) {
    return Error(ERROR_VALUE);
  }
  return jStat.normal.inv(probability, 0, 1);
};