Normal distribution in Java

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian

    Normal distribution in Java

    Hi NG

    I need to get a normal distribution based on a mean and variance. How do I
    do that in Java?

    Is there a standart packet to use?

    Christian
  • Mihai Osian

    #2
    Re: Normal distribution in Java

    There is a single, simple formula. Next time try Google. For now take
    a look at http://mathworld.wolfram.com/NormalDistribution.html

    Christian wrote:
    [color=blue]
    >Hi NG
    >
    >I need to get a normal distribution based on a mean and variance. How do I
    >do that in Java?
    >
    >Is there a standart packet to use?
    >
    >Christian
    >
    >[/color]

    Comment

    • François Grondin

      #3
      Re: Normal distribution in Java

      Did you try java.util.Rando m? There is a method called nextGaussian that
      produced a random value from a normal distribution of mean 0.0 and variance
      1.0.

      From there, generating numbers from a normal distribution of mean m and
      variance v is an easy task.

      François Grondin

      "Christian" <Doom@dahm.dk > wrote in message
      news:pan.2004.0 2.09.11.34.50.5 4497@dahm.dk...[color=blue]
      > Hi NG
      >
      > I need to get a normal distribution based on a mean and variance. How do I
      > do that in Java?
      >
      > Is there a standart packet to use?
      >
      > Christian[/color]


      Comment

      Working...