(p, mean, stdev)
| 119336 | return z > 0 ? 1 - cd : cd; |
| 119337 | } // Approximation of Probit function using inverse error function. |
| 119338 | function quantileNormal(p, mean, stdev) { |
| 119339 | if (p < 0 || p > 1) return NaN; |
| 119340 | return (mean || 0) + (stdev == null ? 1 : stdev) * SQRT2 * erfinv(2 * p - 1); |
| 119341 | } // Approximate inverse error function. Implementation from "Approximating |
| 119342 | // the erfinv function" by Mike Giles, GPU Computing Gems, volume 2, 2010. |
| 119343 | // Ported from Apache Commons Math, http://www.apache.org/licenses/LICENSE-2.0 |
| 119344 | function erfinv(x) { |
no test coverage detected