Skip to content

Instantly share code, notes, and snippets.

Last active Sep 25, 2019
What would you like to do?
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function NORMDIST(x, mean, sd, cumulative) {
// Check parameters
if (isNaN(x) || isNaN(mean) || isNaN(sd)) return '#VALUE!';
if (sd <= 0) return '#NUM!';
// Return normal distribution computed by jStat []
return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment