|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.stats.random.multivariate.Multinomial
public class Multinomial
This class generate random vectors from a multinomial distribution.
The R equivalent function is rmultinom in package normix.
| Constructor Summary | |
|---|---|
Multinomial(int size,
double[] prob)
Construct a Multinomial random vector generator. |
|
Multinomial(int size,
double[] prob,
RandomNumberGenerator rng)
Construct a Multinomial random vector generator. |
|
| Method Summary | |
|---|---|
double[] |
nextVector()
Get the next random vector. |
void |
seed(long... seeds)
Seed the random number generator to produce repeatable sequences. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Multinomial(int size,
double[] prob,
RandomNumberGenerator rng)
size - integer, say N, specifying the total number of objects that are put into K boxes in the typical multinomial experimentprob - numeric non-negative vector of length K, specifying the probability for the K classes; is internally normalized to sum 1rng - a uniform random number generator
public Multinomial(int size,
double[] prob)
size - integer, say N, specifying the total number of objects that are put into K boxes in the typical multinomial experimentprob - numeric non-negative vector of length K, specifying the probability for the K classes; is internally normalized to sum 1| Method Detail |
|---|
public void seed(long... seeds)
RandomVectorGenerator
seed in interface RandomVectorGeneratorseeds - the seedspublic double[] nextVector()
RandomVectorGenerator
nextVector in interface RandomVectorGenerator
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||