Results 1 to 4 of 4
  1. #1
    aeo3 is offline Member
    Join Date
    Apr 2009
    Posts
    1
    Rep Power
    0

    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

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    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.

  3. #3
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    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

  4. #4
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    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.

Similar Threads

  1. Replies: 8
    Last Post: 04-19-2009, 06:50 PM
  2. Generate a random code 4 letters long
    By bl00dr3d in forum New To Java
    Replies: 9
    Last Post: 04-06-2009, 06:32 AM
  3. Trying to Generate Random number
    By PeterFeng in forum New To Java
    Replies: 10
    Last Post: 01-14-2009, 09:37 AM
  4. Generate a random number
    By romina in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:23 AM
  5. How to generate random number in java
    By fernando in forum New To Java
    Replies: 1
    Last Post: 08-01-2007, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •