build/modelscript.umd.js
function approximateZPercentile(z, alpha=true) {
              // If z is greater than 6.5 standard deviations from the mean
              // the number of significant digits will be outside of a reasonable 
              // range.
              if (z < -6.5)
                return 0.0;

              if (z > 6.5)
                return 1.0;

              let factK    = 1;
              let sum      = 0;
              let term     = 1;
              let k        = 0;
              let loopStop = Math.exp(-23);
               
              while (Math.abs(term) > loopStop) {
                term = 0.3989422804 * Math.pow(-1, k) * Math.pow(z, k) / (2 * k + 1) /
                        Math.pow(2, k) * Math.pow(z, k + 1) / factK;
                sum += term;
                k++;
                factK *= k;
              }

              sum += 0.5;

              return (alpha) ? 1 - sum : sum;
            }
function approximateZPercentile(z, alpha=true) {
              // If z is greater than 6.5 standard deviations from the mean
              // the number of significant digits will be outside of a reasonable 
              // range.
              if (z < -6.5)
                return 0.0;

              if (z > 6.5)
                return 1.0;

              let factK    = 1;
              let sum      = 0;
              let term     = 1;
              let k        = 0;
              let loopStop = Math.exp(-23);
               
              while (Math.abs(term) > loopStop) {
                term = 0.3989422804 * Math.pow(-1, k) * Math.pow(z, k) / (2 * k + 1) /
                        Math.pow(2, k) * Math.pow(z, k + 1) / factK;
                sum += term;
                k++;
                factK *= k;
              }

              sum += 0.5;

              return (alpha) ? 1 - sum : sum;
            }
function approximateZPercentile ( z , alpha = true ) { // If z is greater than 6.5 standard deviations from the mean
 // the number of significant digits will be outside of a reasonable 
 // range.
 if ( z < - 6.5 ) return 0.0 ; if ( z > 6.5 ) return 1.0 ; let factK = 1 ; let sum = 0 ; let term = 1 ; let k = 0 ; let loopStop = Math . exp ( - 23 ) ; while ( Math . abs ( term ) > loopStop ) { term = 0.3989422804 * Math . pow ( - 1 , k ) * Math . pow ( z , k ) / ( 2 * k + 1 ) / Math . pow ( 2 , k ) * Math . pow ( z , k + 1 ) / factK ; sum += term ; k ++ ; factK *= k ; } sum += 0.5 ; return ( alpha ) ? 1 - sum : sum ; }
Converts z-score into the probability
@memberOf util
@see {@link https://stackoverflow.com/questions/36575743/how-do-i-convert-probability-into-z-score}
@param {number} z - Number of standard deviations from the mean.
@returns {number} p  - p-value
Converts z - score into the probability