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

Function lognormal

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

Source from the content-addressed store, hash-verified

119492 return Math.exp(quantileNormal(p, mean, stdev));
119493}
119494function lognormal(mean, stdev) {
119495 let mu, sigma;
119496 const dist = {
119497 mean (_) {
119498 if (arguments.length) {
119499 mu = _ || 0;
119500 return dist;
119501 } else return mu;
119502 },
119503 stdev (_) {
119504 if (arguments.length) {
119505 sigma = _ == null ? 1 : _;
119506 return dist;
119507 } else return sigma;
119508 },
119509 sample: ()=>sampleLogNormal(mu, sigma),
119510 pdf: (value)=>densityLogNormal(value, mu, sigma),
119511 cdf: (value)=>cumulativeLogNormal(value, mu, sigma),
119512 icdf: (p)=>quantileLogNormal(p, mu, sigma)
119513 };
119514 return dist.mean(mean).stdev(stdev);
119515}
119516function mixture(dists, weights) {
119517 let m = 0, w1;
119518 function normalize(x) {

Callers

nothing calls this directly

Calls 4

sampleLogNormalFunction · 0.70
densityLogNormalFunction · 0.70
cumulativeLogNormalFunction · 0.70
quantileLogNormalFunction · 0.70

Tested by

no test coverage detected