0

One that would, for example, allow me to create a Poisson random variable with specified lambda and generate random numbers with it, or to calculate the marginals from a discrete joint probability distribution function?

Or should I roll my own? (This is just for fun, I just want to play around with probability a bit, so no practical uses yet :) )

wrongusername
  • 18,564
  • 40
  • 130
  • 214
  • 5
    this is what a search engine is for.. – mre Jan 16 '13 at 04:04
  • 4
    @mre that isn't constructive. The idea is for SO to *become* the answer you find on a search engine..... – mikera Jan 16 '13 at 04:07
  • Check this question http://stackoverflow.com/questions/740602/recommended-java-maths-stats-library – Abhinav Sarkar Jan 16 '13 at 04:07
  • @mikera, yeah..my bad..been on this site all day..need to step away from the machine now.. – mre Jan 16 '13 at 04:09
  • @mikera Except for answers which can already be found with a search engine. That's why we ask people to do research first. In this case, you can actually find the answer to this question *on stackoverflow* with a google search. –  Jan 16 '13 at 04:10
  • @mre I already tried a Google search which didn't turn up anything useful for me – wrongusername Jan 16 '13 at 04:18
  • @mre and what would that Stackoverflow answer be? I couldn't find it myself. – wrongusername Jan 16 '13 at 04:19
  • @wrongusername A search for *probability library java* gives `jprobdist` as the second result - "a Java library for probability and statistics`. If it's specifically Poisson values you're looking for, then a google search for *poisson value java* gives [this SO question](http://stackoverflow.com/questions/750325/java-generator-for-poisson-and-uniform-distributions) –  Jan 16 '13 at 04:22
  • @Telthien ahh thanks! I wasn't looking for Poisson random variables specifically, sorry if that wasn't clear. – wrongusername Jan 16 '13 at 04:24
  • Guava also has a math library that you can check – Arefe Mar 27 '21 at 09:56

1 Answers1

6

Commons Math has a class called PoissonDistribution, from which you can sample random values with sample()

Also, if you want to play around with probability, you should check out R, a language custom-built for probability programming (that also seems to have a pretty vibrant SO presence)

Community
  • 1
  • 1
Peter Elliott
  • 3,273
  • 16
  • 30