jphase
Class SparseContPhaseVar

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

public class SparseContPhaseVar
extends AbstractContPhaseVar

Version:
0.1 This class allows the creation and manipulation of Continuous 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
          Rate Matrix in Sparse representation (CompRowMatrix)
protected  no.uib.cipr.matrix.sparse.SparseVector alpha
          Initial Probability distribution vector
 
Constructor Summary
SparseContPhaseVar(double[] alpha, double[][] A)
          Construcs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)
SparseContPhaseVar(int n)
          Construcs an empty Continuous Phase-type Distribution of size n with sparse representation (CompRowMatrix)
SparseContPhaseVar(no.uib.cipr.matrix.sparse.SparseVector alpha, no.uib.cipr.matrix.sparse.FlexCompRowMatrix A)
          Construcs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)
SparseContPhaseVar(no.uib.cipr.matrix.Vector alpha, no.uib.cipr.matrix.Matrix A)
          Construcs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)
 
Method Summary
 ContPhaseVar 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
 ContPhaseVar newVar(int n)
          Creates a new variable of the same class of the original Continuous 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.AbstractContPhaseVar
cdf, cdf, CV, description, 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 jmarkov.basic.JMarkovElement
equals
 

Field Detail

A

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


alpha

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

Constructor Detail

SparseContPhaseVar

public SparseContPhaseVar(int n)
Construcs an empty Continuous Phase-type Distribution of size n with sparse representation (CompRowMatrix)

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

SparseContPhaseVar

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

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

SparseContPhaseVar

public SparseContPhaseVar(no.uib.cipr.matrix.Vector alpha,
                          no.uib.cipr.matrix.Matrix A)
Construcs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)

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

SparseContPhaseVar

public SparseContPhaseVar(double[] alpha,
                          double[][] A)
Construcs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)

Parameters:
A - rate 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

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

getVector

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

Returns:
Initial probability mass vector

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

copy

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

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

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