Search code examples
pythondatasetprobabilityprobability-distribution

How to generate datasets and probability distributions on a sphere


I need to generate random datasets on a n-sphere. I have already managed to generate a uniform dataset by sampling points from a normal distribution and normalising them. i.e:

    values = np.random.randn(samples,k)
    for i in range  (0,samples) :
        values[i] /=  np.linalg.norm(values[i], axis=0)

What I need to do now is to generate datasets with a lower entropy than the uniform one. How can I do it?

are there some parameters (such as the variance of a gaussian) that guarantee that a certain distribution D_1 has lower entropy than D_2?

Thank you!


Solution

  • Pick a vector offset. Switch your points to np.linalg.norm(values[i] + offset, axis=0).

    This will move points away from where offset points and towards the opposite end. You'll have to play around with it to get the entropy to be what you want, but in general the closer to the origin offset is, the higher the entropy.