@decidables/prospectable-math
Version:
prospectable-math: Equations for calculating Cumulative Prospect Theory
3 lines (2 loc) • 927 B
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).prospectableMath=e()}(this,(function(){"use strict";return class{static a={DEFAULT:.5,MIN:0,MAX:1,STEP:.01,JUMP:.05};static l={DEFAULT:2,MIN:0,MAX:10,STEP:.01,JUMP:.05};static g={DEFAULT:.5,MIN:0,MAX:1,STEP:.01,JUMP:.05};static xal2v(t,e,n){return t>=0?t**e:-n*(-t)**e}static xlv2a(t,e,n){return t>=0?Math.log(n)/Math.log(t):(Math.log(-n)-Math.log(e))/Math.log(-t)}static xav2l(t,e,n){return t>=0?NaN:-n/(-t)**e}static pg2w(t,e){return t**e/(t**e+(1-t)**e)**(1/e)}static vw2u(t,e){if("number"==typeof t&&"number"==typeof e)return t*e;if(t instanceof Array&&e instanceof Array&&t.length>0&&t.length===e.length){let n=0;for(let a=0;a<t.length;a+=1)n+=t[a]*e[a];return n}return NaN}}}));
//# sourceMappingURL=prospectableMath.umd.min.js.map