Linear Collider Forum



Home » Analysis and Reconstruction » Reconstruction » Random number generator with Poisson distribution
Random number generator with Poisson distribution [message #261] Thu, 12 May 2005 13:12 Go to next message
lima
Messages: 47
Registered: May 2004
Location: DeKalb, IL, USA
Hi,

I need to use random numbers following a Poisson distribution. Google tells me that there is such a class in Colt library, cern.jet.random.Poisson:

http://hoschek.home.cern.ch/hoschek/colt/V1.0.3/doc/cern/jet /random/Poisson.html

Can I use this Poisson class within org.lcsim? This would add the dependency on Colt library...

If not, what else I could use? Or should I create my own class for this?

Thanks,
Guilherme
Re: Random number generator with Poisson distribution [message #262 is a reply to message #261] Thu, 12 May 2005 13:22 Go to previous messageGo to next message
tonyj
Messages: 138
Registered: January 2004

HI, actually the latest version of Colt is at:

http://dsd.lbl.gov/~hoschek/colt/

We cannot use it directly since it contains very old versions of AIDA which conflict with other stuff that we use. I would suggest just including the source (unmodified) for any routines you want to use directly into the org.lcsim repository for now, as we do for Jama. We can always switch to using it as an external dependency later.

Tony
Re: Random number generator with Poisson distribution [message #263 is a reply to message #262] Thu, 12 May 2005 13:36 Go to previous messageGo to next message
NormanGraf
Messages: 80
Registered: January 2004
Hello Guilherme,
I've been looking at the Jakarta Commons Math libraries and like the way they are set up. Please take a look at

http://jakarta.apache.org/commons/math/

specifically:

http://jakarta.apache.org/commons/math/userguide/distributio n.html

Norman
Re: Random number generator with Poisson distribution [message #264 is a reply to message #263] Thu, 12 May 2005 14:07 Go to previous messageGo to next message
lima
Messages: 47
Registered: May 2004
Location: DeKalb, IL, USA
Norman,

Indeed the jakarta library seems to be quite easy to use.
I would like to give it a try, how should I proceed? Should I download the .jar and leave it at my CLASSPATH until Tony sets up the project.properties to include this dependency, or as Tony suggested, just copy the source code into the lcsim tree?

Thanks,
Guilherme
Re: Random number generator with Poisson distribution [message #265 is a reply to message #264] Thu, 12 May 2005 14:33 Go to previous messageGo to next message
tonyj
Messages: 138
Registered: January 2004

This doesn't suffer from the same compatibility problems as colt, so it should be fine to add it as a dependency. I will add it to the maven dependencies.

Tony
Re: Random number generator with Poisson distribution [message #266 is a reply to message #265] Thu, 12 May 2005 14:43 Go to previous message
tonyj
Messages: 138
Registered: January 2004

OK, it is added.

For future reference using mevenide in netbeans (or presumably eclipse) makes it trivial to add new dependencies, just click on project, choose Properties, choose dependencies, choose Add, Click Repository to browse all the maven repositories and find the library you want to add, and then click OK.

(Also if you are using Netbeans, netbeans 4.1 was just release this week, and seems to work very well with org.lcsim and mevenide.)

Tony
Previous Topic:Web viewer of lcsim CVS repository
Next Topic:How to get info about a detector component
Goto Forum:
  

[ PDF ]

Current Time: Mon Feb 24 22:12:12 Pacific Standard Time 2020
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software