jphase.generator
Class NeutsDiscPHGenerator

java.lang.Object
  extended by jphase.generator.PhaseGenerator
      extended by 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

Field Summary
 
Fields inherited from class jphase.generator.PhaseGenerator
var
 
Constructor Summary
NeutsDiscPHGenerator(AbstractDiscPhaseVar var)
           
 
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 jphase.generator.PhaseGenerator
getVar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeutsDiscPHGenerator

public NeutsDiscPHGenerator(AbstractDiscPhaseVar var)
Parameters:
var -
Method Detail

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