jphase

## Class SparseContPhaseVar

- java.lang.Object
- - jphase.AbstractContPhaseVar
  - - jphase.SparseContPhaseVar

- All Implemented Interfaces:
    JMarkovElement, ContPhaseVar, PhaseVar

      public class SparseContPhaseVar
      extends AbstractContPhaseVar

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SparseContPhaseVar(double[] alpha, double[][] A)` Constructs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)
    `SparseContPhaseVar(int n)` Constructs 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)` Constructs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)
    `SparseContPhaseVar(no.uib.cipr.matrix.Vector alpha, no.uib.cipr.matrix.Matrix A)` Constructs a continuous Phase-type Distribution with sparse representation (CompRowMatrix)

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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)` Sets the transition matrix of the Phase-type distribution to be A
    `void` | `setVector(no.uib.cipr.matrix.Vector alpha)` Sets the initial probability vector to be 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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface jmarkov.basic.JMarkovElement

      `equals`

- - ### Constructor Detail

    - #### SparseContPhaseVar

          public SparseContPhaseVar(int n)

      Constructs 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)

      Constructs 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)

      Constructs 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)

      Constructs 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`
      Sets the transition matrix of the Phase-type distribution to be A
      Parameters:
        `A` - Transition matrix for the 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`
      Sets the initial probability vector to be 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