Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-15-2009, 10:50 PM
Member
 
Join Date: Apr 2009
Posts: 1
Rep Power: 0
aeo3 is on a distinguished road
Default [SOLVED] How to generate a random number from chi-square
Hi EVerybody,
I would like to generate a random number from chi-square distribution. But I can not find any class that is able to do that.
Thanks in advance
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-15-2009, 11:14 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,353
Rep Power: 8
Fubarable is on a distinguished road
Default
This isn't exactly a Swing question (this is the Swing forum). Have you had a look at Google first? What have you found there? Likely you'll need to download the chi-square data tables from some source. SourceForge may have some useful public domain code for this, but again, likely you best bet will be Google. Best of luck.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-16-2009, 01:29 AM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
Default
I think apache have code for that in org.apache.commons.math
__________________
Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-16-2009, 02:42 AM
CJSLMAN's Avatar
Moderator
 
Join Date: Oct 2008
Location: Mexico
Posts: 1,160
Rep Power: 3
CJSLMAN is on a distinguished road
Default hhhmmm... interesting...
It's been like a million years since I've had anything to do with chi-square. Here are some ideas...

Create a table (like Fubarable commented) or generate the values in the program and (either way) stuff the values in an array. Then randomly generate array indexes and get/pull the elements/values at those indexes.

Luck,
CJSL
__________________
Chris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I generate random numbers in a certain range using the random class? frasifrasi New To Java 8 04-19-2009 06:50 PM
Generate a random code 4 letters long bl00dr3d New To Java 9 04-06-2009 06:32 AM
Trying to Generate Random number PeterFeng New To Java 10 01-14-2009 09:37 AM
Generate a random number romina New To Java 1 08-07-2007 06:23 AM
How to generate random number in java fernando New To Java 1 08-01-2007 08:32 PM


All times are GMT +2. The time now is 12:18 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org