MCPcopy Create free account
hub / github.com/microsoft/SandDance / densityLogNormal

Function densityLogNormal

docs/app/js/sanddance-app.js:119481–119487  ·  view source on GitHub ↗
(value, mean, stdev)

Source from the content-addressed store, hash-verified

119479 return Math.exp(mean + sampleNormal() * stdev);
119480}
119481function densityLogNormal(value, mean, stdev) {
119482 if (value <= 0) return 0;
119483 mean = mean || 0;
119484 stdev = stdev == null ? 1 : stdev;
119485 const z = (Math.log(value) - mean) / stdev;
119486 return Math.exp(-0.5 * z * z) / (stdev * SQRT2PI * value);
119487}
119488function cumulativeLogNormal(value, mean, stdev) {
119489 return cumulativeNormal(Math.log(value), mean, stdev);
119490}

Callers 1

lognormalFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected