jphase
Class ErlangCoxianVar

java.lang.Object
  extended by jphase.AbstractContPhaseVar
      extended by jphase.ErlangCoxianVar
All Implemented Interfaces:
JMarkovElement, ContPhaseVar, PhaseVar

public class ErlangCoxianVar
extends AbstractContPhaseVar
implements PhaseVar

Phase-Type representation of an ErlangCoxian distribution as defined by Osogami and Harchol in "Closed form solutions for mapping general distributions to quasi-minimal PH distributions", 2005.


Constructor Summary
ErlangCoxianVar()
          Constructor of an Erlang Coxian variable in dense representation.
ErlangCoxianVar(int n)
          Constructor of a ErlangCoxian variable in dense representation
ErlangCoxianVar(int n, double p, double lambdaY, double lambdaX1, double lambdaX2, double px)
          Constructor of a ErlangCoxian variable in dense representation
 
Method Summary
 PhaseVar convoExpo(double lambda)
          Creates a Dense Continuous Phase Variable that represents the convolution of the original ErlangCoxian distribution and an exponential phase with rate lambda
 ContPhaseVar copy()
          Creates a deep copy of the original Phase-Type Variable
 java.lang.String description()
          This method return a complete verbal describtion of this element.
 double getLambdaX1()
           
 double getLambdaX2()
           
 double getLambdaY()
           
 no.uib.cipr.matrix.Matrix getMatrix()
          Returns the transition matrix of the Phase-Type Distribution
 int getN()
           
 double getP()
           
 double getPx()
           
 no.uib.cipr.matrix.Vector getVector()
          Returns the initial probability mass vector
 PhaseVar mixtureExpo(double lambda, double p)
          Creates a Dense Continuous Phase Variable that represents the mixture of the original ErlangCoxian distribution (p) and an exponential phase with rate lambda (1-p)
 ContPhaseVar newVar(int n)
          Creates a new variable of the same class of the original Continuous Phase-Type Variable
 void setLambdaX1(double lambdaX1)
           
 void setLambdaX2(double lambdaX2)
           
 void setLambdaY(double lambdaY)
           
 void setMatrix(no.uib.cipr.matrix.Matrix A)
          Rate Matrix = A
 void setN(int n)
           
 void setP(double p)
           
 void setPx(double px)
           
 void setVector(no.uib.cipr.matrix.Vector alpha)
          Initial Probability vector = alpha
 
Methods inherited from class jphase.AbstractContPhaseVar
cdf, cdf, CV, eqResidualTime, expectedValue, getMat0, getMat0Array, getMatrixArray, getNumPhases, getVec0, getVectorArray, label, lossFunction1, lossFunction2, max, max, median, min, min, mix, mix, moment, pdf, pdf, prob, quantil, residualTime, residualVar, stdDeviation, sum, sum, sumGeom, sumPH, sumPH, survival, survival, times, toString, variance, waitingQ
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jphase.PhaseVar
cdf, cdf, CV, expectedValue, getMat0, getMat0Array, getMatrixArray, getNumPhases, getVec0, getVectorArray, lossFunction1, lossFunction2, median, moment, prob, quantil, stdDeviation, survival, survival, variance
 
Methods inherited from interface jmarkov.basic.JMarkovElement
equals, label, toString
 

Constructor Detail

ErlangCoxianVar

public ErlangCoxianVar()
Constructor of an Erlang Coxian variable in dense representation. As default it has just one phase in the Erlang that is taken with probability one. This phase and those of the Coxian distribution has rate 1 per time unit.


ErlangCoxianVar

public ErlangCoxianVar(int n,
                       double p,
                       double lambdaY,
                       double lambdaX1,
                       double lambdaX2,
                       double px)
Constructor of a ErlangCoxian variable in dense representation

Parameters:
n - total number of phases (Erlang degree: n-2)
p - probability of having a positive elapse time in the distribution. 1-p: mass probability at zero
lambdaY - rate of the Erlang distribution
lambdaX1 - rate of the first stage of the Coxian distribution
lambdaX2 - rate of the second stage of the Coxian distribution
px - probability of going from the first to the second stage in the Coxian distribution. 1-p: probability of absorption at the first stage of the Coxian distribution

ErlangCoxianVar

public ErlangCoxianVar(int n)
Constructor of a ErlangCoxian variable in dense representation

Parameters:
n - total number of phases (Erlang degree: n-2) absorption at the first stage of the Coxian distribution
Method Detail

getN

public int getN()
Returns:
Total number of phases

setN

public void setN(int n)
Parameters:
n - Total number of phases

getP

public double getP()
Returns:
Probability of having a positive elapse time in the distribution. 1-p: mass probability at zero

setP

public void setP(double p)
Parameters:
p - Probability of having a positive elapse time in the distribution. 1-p: mass probability at zero

getLambdaY

public double getLambdaY()
Returns:
Erlang distribution rate

setLambdaY

public void setLambdaY(double lambdaY)
Parameters:
lambdaY - Erlang distribution rate

getLambdaX1

public double getLambdaX1()
Returns:
Rate of the first stage at the Coxian distribution

setLambdaX1

public void setLambdaX1(double lambdaX1)
Parameters:
lambdaX1 - Rate of the first stage at the Coxian distribution

getLambdaX2

public double getLambdaX2()
Returns:
Rate of the secons stage at the Coxian distribution

setLambdaX2

public void setLambdaX2(double lambdaX2)
Parameters:
lambdaX2 - Rate of the second stage at the Coxian distribution

getPx

public double getPx()
Returns:
Probability of going from the first to the second stage in the Coxian distribution. 1-p: probability of absorption at the first stage if the Coxian distribution

setPx

public void setPx(double px)
Parameters:
px - Probability of going from the first to the second stage in the Coxian distribution. 1-p: probability of absorption at the first stage if the Coxian distribution

getMatrix

public no.uib.cipr.matrix.Matrix getMatrix()
Description copied from interface: PhaseVar
Returns the transition matrix of the Phase-Type Distribution

Specified by:
getMatrix in interface PhaseVar
Returns:
Transition matrix for transient states of the Phase-Type Distribution

setMatrix

public void setMatrix(no.uib.cipr.matrix.Matrix A)
Description copied from interface: PhaseVar
Rate Matrix = A

Specified by:
setMatrix in interface PhaseVar
Parameters:
A - Transition matrix for transient states of the Phase-Type Distribution

getVector

public no.uib.cipr.matrix.Vector getVector()
Description copied from interface: PhaseVar
Returns the initial probability mass vector

Specified by:
getVector in interface PhaseVar
Returns:
Initial probability mass vector

setVector

public void setVector(no.uib.cipr.matrix.Vector alpha)
Description copied from interface: PhaseVar
Initial Probability vector = alpha

Specified by:
setVector in interface PhaseVar
Parameters:
alpha - Initial probability mass vector

copy

public ContPhaseVar copy()
Description copied from interface: ContPhaseVar
Creates a deep copy of the original Phase-Type Variable

Specified by:
copy in interface ContPhaseVar
Specified by:
copy in interface PhaseVar
Returns:
A deep copy of the original Phase-Type Variable

newVar

public ContPhaseVar newVar(int n)
Description copied from interface: ContPhaseVar
Creates a new variable of the same class of the original Continuous Phase-Type Variable

Specified by:
newVar in interface ContPhaseVar
Parameters:
n - number of Phases of the new Variable
Returns:
A new variable of the same class of the original Continuous Phase-Type Variable

mixtureExpo

public PhaseVar mixtureExpo(double lambda,
                            double p)
Creates a Dense Continuous Phase Variable that represents the mixture of the original ErlangCoxian distribution (p) and an exponential phase with rate lambda (1-p)

Parameters:
lambda - rate of the exponential phase to be included in the mixture
p - probability mass of the ErlangCoxian distribution in the mixture
Returns:
Dense Continuous Phase Variable that represents the mixture of the original ErlangCoxian distribution (p) and an exponential phase with rate lambda (1-p)

convoExpo

public PhaseVar convoExpo(double lambda)
Creates a Dense Continuous Phase Variable that represents the convolution of the original ErlangCoxian distribution and an exponential phase with rate lambda

Parameters:
lambda - rate of the exponential phase to be included in the convolution
Returns:
Dense Continuous Phase Variable that represents the convolution of the original ErlangCoxian distribution and an exponential phase with rate lambda

description

public java.lang.String description()
Description copied from interface: JMarkovElement
This method return a complete verbal describtion of this element. This description may contain multiple text rows.

Specified by:
description in interface JMarkovElement
Overrides:
description in class AbstractContPhaseVar
Returns:
A String describing this element.
See Also:
JMarkovElement.label()