deno.land / x / simplestatistic@v7.7.1 / src / probit.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import epsilon from "./epsilon";import inverseErrorFunction from "./inverse_error_function";
/** * The [Probit](http://en.wikipedia.org/wiki/Probit) * is the inverse of cumulativeStdNormalProbability(), * and is also known as the normal quantile function. * * It returns the number of standard deviations from the mean * where the p'th quantile of values can be found in a normal distribution. * So, for example, probit(0.5 + 0.6827/2) ≈ 1 because 68.27% of values are * normally found within 1 standard deviation above or below the mean. * * @param {number} p * @returns {number} probit */function probit(p) { if (p === 0) { p = epsilon; } else if (p >= 1) { p = 1 - epsilon; } return Math.sqrt(2) * inverseErrorFunction(2 * p - 1);}
export default probit;
simplestatistic

Version Info

Tagged at
2 years ago