Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
};
export function GAUSS(z) {
z = parseNumber(z);
if (z instanceof Error) {
return z;
}
return jStat.normal.cdf(z, 0, 1) - 0.5;
};
.map((_, i) => ({id: i, x: jStat.normal.sample(0, 1), y: jStat.normal.sample(0, 1)}));
exports.NORM.S.INV = function(probability) {
probability = parseNumber(probability);
if (probability instanceof Error) {
return Error(ERROR_VALUE);
}
return jStat.normal.inv(probability, 0, 1);
};