| 7674 | } |
| 7675 | |
| 7676 | double normal_quantile(double p) { |
| 7677 | static const double ROOT_TWO = std::sqrt(2.0); |
| 7678 | |
| 7679 | double result = 0.0; |
| 7680 | assert(p >= 0 && p <= 1); |
| 7681 | if (p < 0 || p > 1) { |
| 7682 | return result; |
| 7683 | } |
| 7684 | |
| 7685 | result = -erfc_inv(2.0 * p); |
| 7686 | // result *= normal distribution standard deviation (1.0) * sqrt(2) |
| 7687 | result *= /*sd * */ ROOT_TWO; |
| 7688 | // result += normal disttribution mean (0) |
| 7689 | return result; |
| 7690 | } |
| 7691 | |
| 7692 | double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n) { |
| 7693 | double sb = stddev.point; |