de.jstacs.utils.random
Class DirichletMRGParams

java.lang.Object
  extended by de.jstacs.utils.random.MRGParams
      extended by de.jstacs.utils.random.DiMRGParams
          extended by de.jstacs.utils.random.DirichletMRGParams

public class DirichletMRGParams
extends DiMRGParams

The container for parameters of a Dirichlet random generator.

Author:
Jens Keilwagen
See Also:
DiMRGParams, FastDirichletMRGParams

Constructor Summary
DirichletMRGParams(double... alpha)
          Constructor which creates a new hyperparameter vector for a Dirichlet random generator.
DirichletMRGParams(double alpha, int n)
          Constructor which creates a new hyperparameter vector for a Dirichlet random generator.
DirichletMRGParams(int start, int end, double... alpha)
          Constructor which creates a new hyperparameter vector for a Dirichlet random generator.
 
Method Summary
 int getDimension()
          Returns the dimension of the hyperparameter vector of the underlying Dirichlet distribution and therefore the dimension of the generated random array.
 double getHyperparameter(int i)
          Returns the value at position i of the hyperparameter vector of the underlying Dirichlet distribution.
 double getSumOfHyperparameter()
          Returns the sum of the hyperparameters (entries of the hyperparameter vector) of the underlying Dirichlet distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirichletMRGParams

public DirichletMRGParams(double alpha,
                          int n)
                   throws IllegalArgumentException
Constructor which creates a new hyperparameter vector for a Dirichlet random generator. The hyperparameter vector of the underlying Dirichlet distribution consists of the same value at every position.

Parameters:
alpha - the value for the hyperparameter vector
n - the dimension of the hyperparameter vector
Throws:
IllegalArgumentException - if n is chosen incorrectly (has to be greater than 2) or if alpha is chosen incorrectly (has to be positive)
See Also:
FastDirichletMRGParams.FastDirichletMRGParams(double)

DirichletMRGParams

public DirichletMRGParams(double... alpha)
                   throws IllegalArgumentException
Constructor which creates a new hyperparameter vector for a Dirichlet random generator.

Parameters:
alpha - the hyperparameter vector
Throws:
IllegalArgumentException - if at least one of the hyperparameters is not positive

DirichletMRGParams

public DirichletMRGParams(int start,
                          int end,
                          double... alpha)
                   throws IllegalArgumentException
Constructor which creates a new hyperparameter vector for a Dirichlet random generator.

Parameters:
start - start index (inclusive)
end - end index (exclusive)
alpha - the hyperparameter vector
Throws:
IllegalArgumentException - if at least one of the hyperparameters is not positive
Method Detail

getDimension

public int getDimension()
Description copied from class: DiMRGParams
Returns the dimension of the hyperparameter vector of the underlying Dirichlet distribution and therefore the dimension of the generated random array.

Specified by:
getDimension in class DiMRGParams
Returns:
the dimension of the hyperparameter vector of the underlying Dirichlet distribution and therefore the dimension of the generated random array

getHyperparameter

public double getHyperparameter(int i)
Description copied from class: DiMRGParams
Returns the value at position i of the hyperparameter vector of the underlying Dirichlet distribution.

Specified by:
getHyperparameter in class DiMRGParams
Parameters:
i - the position of the hyperparameter vector
Returns:
the value at position i of the hyperparameter vector of the underlying Dirichlet distribution

getSumOfHyperparameter

public double getSumOfHyperparameter()
Returns the sum of the hyperparameters (entries of the hyperparameter vector) of the underlying Dirichlet distribution.

Returns:
the sum of the hyperparameters (entries of the hyperparameter vector) of the underlying Dirichlet distribution