|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.randvarmulti.RandomMultivariateGen umontreal.iro.lecuyer.randvarmulti.DirichletGen
public class DirichletGen
Extends RandomMultivariateGen
for a
Dirichlet distribution. This distribution uses the
parameters
α1,..., αk, and has density
Here, the successive coordinates of the Dirichlet vector are generated
via the class
GammaAcceptanceRejectionGen
in package randvar, using the same stream for all the uniforms.
Constructor Summary | |
---|---|
DirichletGen(RandomStream stream,
double[] alphas)
Constructs a new Dirichlet generator with parameters αi+1 = alphas[i], for i = 0,…, k - 1, and the stream stream. |
Method Summary | |
---|---|
double |
getAlpha(int i)
Returns the αi+1 parameter for this Dirichlet generator. |
void |
nextPoint(double[] p)
Generates a point from the Dirichlet distribution. |
static void |
nextPoint(RandomStream stream,
double[] alphas,
double[] p)
Generates a new point from the Dirichlet distribution with parameters alphas, using the stream stream. |
Methods inherited from class umontreal.iro.lecuyer.randvarmulti.RandomMultivariateGen |
---|
getDimension, getStream, nextArrayOfPoints, setStream |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DirichletGen(RandomStream stream, double[] alphas)
stream
- the random number stream used to generate uniforms.alphas
- the αi parameters of the generated distribution.
IllegalArgumentException
- if one αk is negative or 0.
NullPointerException
- if any argument is null.Method Detail |
---|
public double getAlpha(int i)
i
- the index of the parameter.
ArrayIndexOutOfBoundsException
- if i is
negative or greater than or equal to getDimension
.public static void nextPoint(RandomStream stream, double[] alphas, double[] p)
stream
- the random number stream used to generate the uniforms.alphas
- the αi parameters of the distribution, for
i = 1,…, k.p
- the array to be filled with the generated point.public void nextPoint(double[] p)
nextPoint
in class RandomMultivariateGen
p
- the array to be filled with the generated point.
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |