| 7451 | } |
| 7452 | |
| 7453 | double normal_quantile(double p) { |
| 7454 | static const double ROOT_TWO = std::sqrt(2.0); |
| 7455 | |
| 7456 | double result = 0.0; |
| 7457 | assert(p >= 0 && p <= 1); |
| 7458 | if (p < 0 || p > 1) { |
| 7459 | return result; |
| 7460 | } |
| 7461 | |
| 7462 | result = -erfc_inv(2.0 * p); |
| 7463 | // result *= normal distribution standard deviation (1.0) * sqrt(2) |
| 7464 | result *= /*sd * */ ROOT_TWO; |
| 7465 | // result += normal disttribution mean (0) |
| 7466 | return result; |
| 7467 | } |
| 7468 | |
| 7469 | double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n) { |
| 7470 | double sb = stddev.point; |