mymath
Class MyRandom
java.lang.Object
mymath.MyRandom
public class MyRandom
- extends java.lang.Object
Method Summary |
static double[] |
randomCPTRow(int length)
|
static int[] |
randomIntArray(int length,
int maxindex)
|
static int |
randomInteger(int max)
|
static long |
randomInteger(long max)
|
static int |
randomPoisson(double lambda)
|
static void |
randSeqToFile(double bias,
java.lang.String filename,
int length)
|
static double |
sampleBeta(double e,
double v)
Sample a parameter p in [0,1] according to a beta
distribution that has mean e and variance v. |
static boolean |
toss(double bias)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyRandom
public MyRandom()
toss
public static boolean toss(double bias)
randSeqToFile
public static void randSeqToFile(double bias,
java.lang.String filename,
int length)
randomInteger
public static int randomInteger(int max)
randomInteger
public static long randomInteger(long max)
randomCPTRow
public static double[] randomCPTRow(int length)
randomIntArray
public static int[] randomIntArray(int length,
int maxindex)
randomPoisson
public static int randomPoisson(double lambda)
sampleBeta
public static double sampleBeta(double e,
double v)
- Sample a parameter p in [0,1] according to a beta
distribution that has mean e and variance v.
e and v must be such that appropriate parameters alpha,beta for
the beta distribution can be found.
Implementation is only efficient for
small values of alpha and beta