jphase.generator
Class NeutsDiscPHGenerator
java.lang.Object
jphase.generator.PhaseGenerator
jphase.generator.NeutsDiscPHGenerator
public class NeutsDiscPHGenerator
- extends PhaseGenerator
This class implements the algorithm proposed
by Neuts and Pagano "generating Random Variates
of Phase-Type", 1981. This is also based in the
so called alias method to generate a variate from
a discrete distribution. This class implements
the algorithm for the discrete case.
- Author:
- Juan Fernando Pérez
Method Summary |
double |
getRandom()
|
double[] |
getRandom(int num)
|
protected void |
initialize()
Initialize the cutoff values and the aliases for the initial
probability distribution and the transition probability matrix |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NeutsDiscPHGenerator
public NeutsDiscPHGenerator(AbstractDiscPhaseVar var)
- Parameters:
var
-
getRandom
public double getRandom()
- Specified by:
getRandom
in class PhaseGenerator
- Returns:
- A random number that has a probability
distribution of Phase-Type
getRandom
public double[] getRandom(int num)
- Specified by:
getRandom
in class PhaseGenerator
- Parameters:
num
- Number of variates to be generated
- Returns:
- A vector of random numbers that have a probability
distribution of Phase-Type
initialize
protected void initialize()
- Description copied from class:
PhaseGenerator
- Initialize the cutoff values and the aliases for the initial
probability distribution and the transition probability matrix
- Specified by:
initialize
in class PhaseGenerator