jphase
Class SparseDiscPhaseVar

java.lang.Object
  extended by jphase.AbstractDiscPhaseVar
      extended by jphase.SparseDiscPhaseVar
All Implemented Interfaces:
JMarkovElement, DiscPhaseVar, PhaseVar

public class SparseDiscPhaseVar
extends AbstractDiscPhaseVar

Version:
0.1 This class allows the creation and manipulation of Discrete Phase-type distributions represented by sparse (Flexible Compressed Row) matrices.
Author:
German Riaņo, Juan Fernando Perez

Field Summary
protected  no.uib.cipr.matrix.sparse.FlexCompRowMatrix A
          Transition Matrix in Sparse representation (FlexCompRowMatrix)
protected  no.uib.cipr.matrix.sparse.SparseVector alpha
          Initial Probability distribution vector
 
Constructor Summary
SparseDiscPhaseVar(double[] alpha, double[][] A)
          Construcs a discrete Phase-type Distribution with sparse representation (FlexCompRowMatrix)
SparseDiscPhaseVar(int n)
          Construcs an empty Discrete Phase-type Distribution of size n with sparse representation (FlexCompRowMatrix)
SparseDiscPhaseVar(no.uib.cipr.matrix.sparse.SparseVector alpha, no.uib.cipr.matrix.sparse.FlexCompRowMatrix A)
          Construcs a discrete Phase-type Distribution with sparse representation (FlexCompRowMatrix)
SparseDiscPhaseVar(no.uib.cipr.matrix.Vector alpha, no.uib.cipr.matrix.Matrix A)
          Construcs a discrete Phase-type Distribution with sparse representation (FlexCompRowMatrix)
 
Method Summary
 DiscPhaseVar copy()
          Creates a deep copy of the original Phase-Type Variable
 no.uib.cipr.matrix.Matrix getMatrix()
          Returns the transition matrix of the Phase-Type Distribution
 no.uib.cipr.matrix.Vector getVector()
          Returns the initial probability mass vector
 DiscPhaseVar newVar(int n)
          Creates a new variable of the same class of the original Discrete Phase-Type Variable
 void setMatrix(no.uib.cipr.matrix.Matrix A)
          Rate Matrix = A
 void setVector(no.uib.cipr.matrix.Vector alpha)
          Initial Probability vector = alpha
 
Methods inherited from class jphase.AbstractDiscPhaseVar
cdf, cdf, CV, description, expectedValue, getMat0, getMat0Array, getMatrixArray, getNumPhases, getVec0, getVectorArray, label, lossFunction1, lossFunction2, max, max, median, min, min, mix, mix, moment, pmf, pmf, prob, quantil, stdDeviation, sum, sum, sumGeom, sumPH, sumPH, survival, survival, toString, variance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmarkov.basic.JMarkovElement
equals
 

Field Detail

A

protected no.uib.cipr.matrix.sparse.FlexCompRowMatrix A
Transition Matrix in Sparse representation (FlexCompRowMatrix)


alpha

protected no.uib.cipr.matrix.sparse.SparseVector alpha
Initial Probability distribution vector

Constructor Detail

SparseDiscPhaseVar

public SparseDiscPhaseVar(int n)
Construcs an empty Discrete Phase-type Distribution of size n with sparse representation (FlexCompRowMatrix)

Parameters:
n - size of the Discrete Phase-type Distribution

SparseDiscPhaseVar

public SparseDiscPhaseVar(no.uib.cipr.matrix.sparse.SparseVector alpha,
                          no.uib.cipr.matrix.sparse.FlexCompRowMatrix A)
Construcs a discrete Phase-type Distribution with sparse representation (FlexCompRowMatrix)

Parameters:
A - transition probability matrix
alpha - initial probability distribution vector

SparseDiscPhaseVar

public SparseDiscPhaseVar(no.uib.cipr.matrix.Vector alpha,
                          no.uib.cipr.matrix.Matrix A)
Construcs a discrete Phase-type Distribution with sparse representation (FlexCompRowMatrix)

Parameters:
A - transition probability matrix
alpha - initial probability distribution vector

SparseDiscPhaseVar

public SparseDiscPhaseVar(double[] alpha,
                          double[][] A)
Construcs a discrete Phase-type Distribution with sparse representation (FlexCompRowMatrix)

Parameters:
A - transtion probability matrix
alpha - initial probability distribution vector
Method Detail

getMatrix

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

Returns:
Transition matrix for transient states of the Phase-Type Distribution
See Also:
PhaseVar.getMatrix()

setMatrix

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

Parameters:
A - Transition matrix for transient states of the Phase-Type Distribution
See Also:
PhaseVar.setMatrix(no.uib.cipr.matrix.Matrix)

getVector

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

Returns:
Initial probability mass vector
See Also:
PhaseVar.getVector()

setVector

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

Parameters:
alpha - Initial probability mass vector
See Also:
PhaseVar.setVector(no.uib.cipr.matrix.Vector)

copy

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

Returns:
A deep copy of the original Phase-Type Variable
See Also:
ContPhaseVar.copy()

newVar

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

Parameters:
n - number of Phases of the new Variable
Returns:
A new variable of the same class of the original Discrete Phase-Type Variable