Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

The plotting is quite painful, so here's a cleaner, faster version (credit HYRY credit HYRY):

The plotting is quite painful, so here's a cleaner, faster version (credit HYRY):

The plotting is quite painful, so here's a cleaner, faster version (credit HYRY):

replaced http://math.stackexchange.com/ with https://math.stackexchange.com/
Source Link

Thanks to Michael Hardy for that explanation that explanation.

Thanks to Michael Hardy for that explanation.

Thanks to Michael Hardy for that explanation.

added 708 characters in body
Source Link
Veedrac
  • 9.8k
  • 23
  • 38

Instead, generate the original points with a normal distribution. I'm not sure how to explain

This is because the result intuitivelystandard normal distribution has a probability density function of

$$ \phi(x) = \frac{1}{\sqrt{2\pi}}\exp\left(-x^2/2\right) $$

so a 2D one has probability density

$$ \phi(x, y) = \phi(x) \phi(y) = \frac{1}{2\pi}\exp\left(-(x^2 + y^2)/2\right) $$

which can be expressed solely in terms of the distance from the origin, but it\$r = \sqrt{x^2 + y^2}\$:

$$ \phi(r) = \frac{1}{2\pi}\exp\left(-r^2/2\right) $$

This formula applies for any number of dimensions (including \1ドル\$). This means that the distribution is independent of rotation (in any axis) and thus must be evenly distributed along the surface of an n-sphere.

Thanks to Michael Hardy for that explanation .

This is as simple as using instead

Instead, generate the original points with a normal distribution. I'm not sure how to explain the result intuitively, but it is as simple as using instead

Instead, generate the original points with a normal distribution.

This is because the standard normal distribution has a probability density function of

$$ \phi(x) = \frac{1}{\sqrt{2\pi}}\exp\left(-x^2/2\right) $$

so a 2D one has probability density

$$ \phi(x, y) = \phi(x) \phi(y) = \frac{1}{2\pi}\exp\left(-(x^2 + y^2)/2\right) $$

which can be expressed solely in terms of the distance from the origin, \$r = \sqrt{x^2 + y^2}\$:

$$ \phi(r) = \frac{1}{2\pi}\exp\left(-r^2/2\right) $$

This formula applies for any number of dimensions (including \1ドル\$). This means that the distribution is independent of rotation (in any axis) and thus must be evenly distributed along the surface of an n-sphere.

Thanks to Michael Hardy for that explanation .

This is as simple as using instead

deleted 68 characters in body
Source Link
Veedrac
  • 9.8k
  • 23
  • 38
Loading
deleted 68 characters in body
Source Link
Veedrac
  • 9.8k
  • 23
  • 38
Loading
Source Link
Veedrac
  • 9.8k
  • 23
  • 38
Loading
lang-py

AltStyle によって変換されたページ (->オリジナル) /