How to generate uniformly random points on n-spheres and in n-balls
extremelearning.com.au
How to generate uniformly random points on n-spheres and in n-balls
1–10 of 87 posts
Re: How to generate uniformly random points on n-spheres and in n-balls
#2Re: How to generate uniformly random points on n-spheres and in n-balls
#3I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?
Re: How to generate uniformly random points on n-spheres and in n-balls
#4I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?
Re: How to generate uniformly random points on n-spheres and in n-balls
#5I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?
https://numpy.org/doc/stable/reference/random/generated/nump...
Or in god's own words (TAOCP section 3.4):
Applications of random numbers often call for other kinds of distributions, however; for example, if we want to make a random choice from among k alternatives, we want a random integer between 1 and k. If some simulation process calls for a random waiting time between occurrences of independent events, a random number with the exponential distribution is desired. Sometimes we don't even want random numbers — we want a random permutation (a random arrangement of n objects) or a random combination (a random choice of k objects from a collection of n).
In principle, any of these other random quantities can be obtained from the uniform deviates U0, U1, U2, ...; people have devised a number of important "random tricks" for the efficient transformation of uniform deviates. A study of these techniques also gives us insight into the proper use of random numbers in any Monte Carlo application.
Re: How to generate uniformly random points on n-spheres and in n-balls
#61. Truncate your lat longs to some arbitrary decimal place (this is very very stupid, you end up with grid lines [1])
2. The above method ^^ but everyone tries basically doing like random angle + random length along angle, which doesn't generate uniform results in a circle as the article mentions[2]. So then you try generating points in a box that encloses your circle, and rejecting anything outside the circle, but that smells bad. So you do some googling and find method 6 listed in the article (Good! and Fast!)
3. Realize that fuzzing points is stupid, what you really want is to view points in aggregate anyways, so you try heat maps
[1]: Ok you always end up with grid lines, but truncating to like 1-6 decimal places produces very obvious grid lines to the human eye
[2]: Try this in pyplot! You'll see right away with ~100 points its not uniform in the way you expect
Re: How to generate uniformly random points on n-spheres and in n-balls
#7I think the best illustration of "reasonable choices of what random values should be used leading to biased results" is Bertrand's paradox which I was introduced to via numberphile/3blue1brown: https://www.youtube.com/watch?v=mZBwsm6B280 and am just glad that nothing I have ever needed random sampling for has ever been important :D
[1] please don't use this blindly, I'm really just going off very old recollection, if you need it google random sphere sampling :D
Re: How to generate uniformly random points on n-spheres and in n-balls
#8I actually needed this at work once! We needed to fuzz peoples address in a mapped view for analytics, without revealing PII. It ended up never being shipped, but we needed to fuzz geographic data and the thinking was like: 1. Truncate your lat longs to some arbitrary decimal place (this is very very stupid, you end up with grid lines [1]) 2. The above method ^^ but everyone tries basically doing like random angle +…
https://extremelearning.com.au/how-to-evenly-distribute-poin...
Re: How to generate uniformly random points on n-spheres and in n-balls
#9I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?
My reasoning is, if you are counting cards in a game, you are giving yourself an advantage. But what really happens is that from your point of view cards will be drawn less and less uniformly randomly. Or put in another way, if you know the distribution is normal, you can bet on the the result being near the center and come out on top, but if it’s uniformly random distribution all hopes are out.
Re: How to generate uniformly random points on n-spheres and in n-balls
#10I'm definitely not at all qualified to talk about this, but... aren't "uniform" and "random" antonyms?
The easiest example most people are aware of in practice is throwing two 6 sided dice vs one 12 sided dice. The outcome of both is random, but people seem to know fairly intuitively that the two dice case produces is more likely to produce middle values than extreme ones, while the single 12 sided dice doesn't have that behavior.