18,902
edits
m (+cat) |
m (link fixes) |
||
Line 1: | Line 1: | ||
To value types: | To value types: | ||
Line 85: | Line 82: | ||
[[User:Neo|Neo]] | [[User:Neo|Neo]] | ||
:The term "inverse normal" is apparently not conventional, and also rather confusing because it can be mistaken as referring to either the [[wikipedia:Normal-inverse_Gaussian_distribution|normal-inverse Gaussian distribution]] or the [[wikipedia:Inverse_Gaussian_distribution|inverse Gaussian distribution]], both of which are rather exotic and irrelevant here. | :The term "inverse normal" is apparently not conventional, and also rather confusing because it can be mistaken as referring to either the [[wikipedia:Normal-inverse_Gaussian_distribution|normal-inverse Gaussian distribution]] or the [[wikipedia:Inverse_Gaussian_distribution|inverse Gaussian distribution]], both of which are rather exotic and irrelevant here. | ||
:What we have here is the inverse of the [[wikipedia:Error_function|error function]] or rather that of [[wikipedia:Normal_distribution# | :What we have here is the inverse of the [[wikipedia:Error_function|error function]] or rather that of [[wikipedia:Normal_distribution#Standard_deviation_and_coverage|erfc(x/sqrt(2))]]. If you have Java installed, [https://onlinestatbook.com/analysis_lab/inverse_normal_dist.html HERE] is a nice applet that you can toy around with to see just what the table in your PDF link corresponds to. | ||
:As further pointed out [[wikipedia:Normal_distribution# | :As further pointed out [[wikipedia:Normal_distribution#Generating_values_from_normal_distribution|HERE]], inverting the [[wikipedia:Normal_distribution#Cumulative_distribution_functions|standard normal cdf]] gives you a way to generate ''normally'' distributed random variables from a ''uniformly'' distributed random variable, which is exactly what Oni does (see Neo's code sample above). | ||
:The float r is a ''uniformly'' distributed random variable in (-1.0,1.0) (@ Neo: please check). Same for x except the interval is now [0.0,10.0). z is a first approximation of erfc(0.0998 * x / sqrt(2)), interpolated linearly between erfc(0.0998 * floorf(x) / sqrt(2)) and erfc(0.0998 * (floorf(x) + 1) / sqrt(2)). The table is thus sampled uniformly. | :The float r is a ''uniformly'' distributed random variable in (-1.0,1.0) (@ Neo: please check). Same for x except the interval is now [0.0,10.0). z is a first approximation of erfc(0.0998 * x / sqrt(2)), interpolated linearly between erfc(0.0998 * floorf(x) / sqrt(2)) and erfc(0.0998 * (floorf(x) + 1) / sqrt(2)). The table is thus sampled uniformly. | ||
:The result ( v1 + z * v2 ) is, to a good approximation, a ''normally'' distributed random variable, centered at v1 and with standard mean deviation v2. Apart from the approximation arising from the linear interpolation, the distribution is cut off at 99.8% of expectancy, so all the values will be within 3.09023*v2 of v1. | :The result ( v1 + z * v2 ) is, to a good approximation, a ''normally'' distributed random variable, centered at v1 and with standard mean deviation v2. Apart from the approximation arising from the linear interpolation, the distribution is cut off at 99.8% of expectancy, so all the values will be within 3.09023*v2 of v1. |