Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Random angles on the interval [0, 2Pi]

  1. Sep 28, 2011 #1
    Using Mathematica, I need to define a discrete probability distribution of N equally spaced angles on the interval [0, 2Pi], which isn't exactly uniform. More precisely, I need the distribution to feature a "Poisson-like" behavior : the angles should be randomly selected by random "packs" distributed on the interval, a bit like the rough "diagram" below :

    Code (Text):

        |       | |                               |   |                   |
      | |       | | |     | |     |     |       | | | |   | |   |     | | |     |
    | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
    0                                                                            2Pi
     
    I don't want the distribution to be fully uniform...

    Any idea how to do this with Mathematica ?
     
  2. jcsd
  3. Sep 28, 2011 #2

    Stephen Tashi

    User Avatar
    Science Advisor

    If you select angles from a uniform distribution, you will get random places where angle values are selected more than once. You'll have to be precise about what "Poisson-like" behavior means if you wan't something different than that.
     
  4. Sep 28, 2011 #3
    An uniform distribution means that each angle has the same probability as any other angle. The angles will then be picked-up at the same "rate". This is not what I need. Some angles must be more probable than others, and the angles should show some "packs", randomly distributed on the whole interval (without having an uniform distribution). Poissonian statistics shows something similar. Look again at the "graphics" I've drawn in my first post.
     
  5. Sep 28, 2011 #4

    Stephen Tashi

    User Avatar
    Science Advisor

    This does not imply that the realizations from a uniform distribution create an even pattern. In fact, for a small number of realizations, it is unlikely that they would.


    The graphics show you have an intuitive concept, not that you understand the Poisson distribution. You haven't managed to define a precise mathematical requirement. It isn't clear from your graphics whether they are supposed to represent a distribution for one realization of a random variable or whether they are supposed to represent a typical sample of 21 independent realizations of the same random variable.

    The Poisson distribution is often used as an approximation for the binomial distribution where the probability of "success" is small. If you use a uniform distribution for the angles, the probability that a given angle is realized is 1/180. The probability it is realized k times is n draws is given by the binomial distribution for n trials with probability 1/N of success evaluated at k successes. In what sense, do you think that using a uniform distribution will fail to produce "Poissonian statistics" ? What specific statistics you are talking about?)
     
  6. Sep 28, 2011 #5
    The distribution I'm looking for will be used for a large number of trials, so the uniform distribution will give an ... uniform distribution of points. I don't want this.

    The angular distribution will be used to define points on a ring. I don't want the points to be uniformly distributed on the ring. I need the points to form "packs" here and there. The packs themselves should be random. Again, an uniform distribution can't do this, on a large set of points.
     
  7. Sep 28, 2011 #6

    Stephen Tashi

    User Avatar
    Science Advisor

    Then it isn't clear to me why you don't simply make up a "clumpy" distribution of angles and use it. Your requirement is too vague to imply a specific method.
     
  8. Sep 28, 2011 #7
    Isn't "Perlin noise" what I'm looking for ? I don't know how to define the Perlin noise with Mathematica, though.
     
  9. Sep 29, 2011 #8

    chiro

    User Avatar
    Science Advisor

    Bacle, you need to provide some concise constraints for your distribution.

    Maybe what you should do is use a statistical package like R and create a custom distribution by supplying some kind of transformation. One method you could do is to create a function that takes the input of a uniform random number generator and uses that to create your custom distribution. Since you have a finite number of possibilities, you just map one finite interval from your uniform input to another finite interval in your custom distribution.

    The above should take you probably 10 to 20 minutes at the most, and then you can do all kinds of statistical analysis based on this custom distribution.
     
  10. Sep 29, 2011 #9
    I don't understand your suggestion.

    I don't have any constraint on my distribution, except that it's almost uniform, with random packs of "concentration" here and there. I need the points on the circle to feel "natural", i.e. randomly distributed without giving the impression of an uniform distribution if there's a large number of points.

    I can define the "packets" on the circle by hand, but it wont feel very "natural".

    I have the impression that "Perlin noise" is the solution, but I know nothing about this.
     
    Last edited: Sep 29, 2011
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook