geometry statistics
How
- Draw from a standard distribution for each dimension.
- Do not draw from a uniform distribution.
Implementation
import numpy as np
import torch
# numpy
v = np.random.normal(0, 1, size)
# torch
v = torch.normal(torch.tensor([0.0] * size), torch.tensor([1.0] * size))
Why that works
- Considering a 2D space, the probability of a point being at (x,y) is P(x)P(y)
- The PDF for the standard distribution is P(x)=2π1e−21x2, which is roughly in the form of ex2
- Thus P(x)P(y) is in the form of ex2+y2, which is a function of the distance to the origin
- So the resulting distribution is radially symmetric around the origin
- Considering a 2D space, uniformly sampling from both dimension results in a square population
- Whereas a random distribution in 2D space should be a circle
- This is called the corner effect