• Post Reply Bookmark Topic Watch Topic
  • New Topic

random numbers from Gamma distirbution  RSS feed

 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I generate random numbers from gamma(2, 3)? I've seen 3 packages, but none works for me. I am running OS X Lion, it didn't work on my friend's PC either.
1. SSJ from University of Montreal
http://www.iro.umontreal.ca/~simardr/ssj/indexe.html

2. The JSC library
http://www.jsc.nildram.co.uk/downloads/download.html

3. The eduni package
http://www.icsa.inf.ed.ac.uk/research/groups/hase/simjava/distributions/

I right-clicked my class, add External Jars, clicked ok. Am I not importing them right?

But I just can't use it, very frustrating, how is everyone else dealing with this?
 
Zeeshan Sheikh
Ranch Hand
Posts: 144
Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These packages have their requirements

1. JSC: J2SE v1.4.1

2. SSj: Compatable with JDK 5.0

3. ICSA: JDK 1.4

Just select the package that you need to use and import it. I do not see any reason why it would not work.
 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zeeshan Sheikh wrote:These packages have their requirements

1. JSC: J2SE v1.4.1

2. SSj: Compatable with JDK 5.0

3. ICSA: JDK 1.4

Just select the package that you need to use and import it. I do not see any reason why it would not work.


Could you be more specific? Been trying to import for couple hours.

I have all 3 added.

When I type: import eduni.distributions.*;
There is a red underline under eduni, and I can't use it. But I see eduni.jar under reference libraries.
 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I am going to abandon all the above and start with this fresh!
Please look out for my back, let me know if I am doing something wrong. thanks!

Here's the API:
http://commons.apache.org/math/apidocs/org/apache/commons/math/special/Gamma.html

Here's the download site:
http://commons.apache.org/logging/download_logging.cgi

Step 1:
I downloaded under binaries
commons-logging-1.1.1-bin.tar.gz

Step 2:
unzip the folder, there are 5 .jar, I dragged commons-logging-1.1.1-sources.jar to my reference library. ONLY this one, just to try.

Step 3:
add to external in eclipse.

Now how do I import it? What should I type import? co. what is going on?!
 
Zeeshan Sheikh
Ranch Hand
Posts: 144
Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I am saying JRE requirements are different for these packages.

1. Make sure you have JRE 1.4 for JSC & ICSA (These two packages can be imported together)

2. If you want to use SSJ then you need JRE 1.5 (This package can be imported alone)

3. All I am saying make sure you have right JRE version for package.

I hope you are NOT trying to run it on JRE 7. Please check requirements on their website.
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think your suggestions about version of Java™ are mistaken. It ought to work on any version newer than Java5.
 
collin collins
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:I think your suggestions about version of Java™ are mistaken. It ought to work on any version newer than Java5.


I figured it out! My problem is setting the path to /Referenced Libraries instead of under /SRC.

All the red underlines went away, yes!
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!