jphase

## Class DenseDiscPhaseVar

- java.lang.Object
- - jphase.AbstractDiscPhaseVar
  - - jphase.DenseDiscPhaseVar

- All Implemented Interfaces:
    JMarkovElement, DiscPhaseVar, PhaseVar

      public class DenseDiscPhaseVar
      extends AbstractDiscPhaseVar
      implements DiscPhaseVar

  This class allows the creation and manipulation of Discrete Phase-type distributions represented by dense matrices.
  Version:
    0.1
  Author:
    German Riaņo, Juan F. Perez

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DenseDiscPhaseVar()` Constructs an empty Discrete Phase-type Distribution with dense representation
    `DenseDiscPhaseVar(no.uib.cipr.matrix.DenseVector alpha, no.uib.cipr.matrix.DenseMatrix A)` Constructs a Discrete Phase-type Distribution with dense representation
    `DenseDiscPhaseVar(double[] alpha, double[][] A)` Constructs a Discrete Phase-type Distribution with dense representation
    `DenseDiscPhaseVar(int n)` Constructs an empty Discrete Phase-type Distribution of size n with dense representation
    `DenseDiscPhaseVar(no.uib.cipr.matrix.Vector alpha, no.uib.cipr.matrix.Matrix A)` Constructs a Discrete Phase-type Distribution with dense representation

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DiscPhaseVar` | `copy()` Creates a deep copy of the original Phase-Type Variable
    `static DenseDiscPhaseVar` | `Geom(double p)` Discrete Phase distribution that represents a geometric distribution with probability of success p
    `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
    `static DenseDiscPhaseVar` | `NegativeBinomial(double p, int r)` Discrete Phase Distribution that represents a Negative Binomial distribution with parameters p and r
    `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)` 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.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

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

    - ### Methods inherited from interface jphase.DiscPhaseVar

      `max, max, min, min, mix, mix, pmf, pmf, sum, sum, sumGeom, sumPH, sumPH, toString`

    - ### 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

      `description, equals, label`

- - ### Constructor Detail

    - #### DenseDiscPhaseVar

          public DenseDiscPhaseVar()

      Constructs an empty Discrete Phase-type Distribution with dense representation

    - #### DenseDiscPhaseVar

          public DenseDiscPhaseVar(int n)

      Constructs an empty Discrete Phase-type Distribution of size n with dense representation
      Parameters:
        `n` - size of the Discrete Phase-type Distribution

    - #### DenseDiscPhaseVar

          public DenseDiscPhaseVar(no.uib.cipr.matrix.DenseVector alpha,
                           no.uib.cipr.matrix.DenseMatrix A)

      Constructs a Discrete Phase-type Distribution with dense representation
      Parameters:
        `A` - transition probability matrix
        `alpha` - initial probability distribution vector

    - #### DenseDiscPhaseVar

          public DenseDiscPhaseVar(no.uib.cipr.matrix.Vector alpha,
                           no.uib.cipr.matrix.Matrix A)

      Constructs a Discrete Phase-type Distribution with dense representation
      Parameters:
        `A` - transition probability matrix
        `alpha` - initial probability distribution vector

    - #### DenseDiscPhaseVar

          public DenseDiscPhaseVar(double[] alpha,
                           double[][] A)

      Constructs a Discrete Phase-type Distribution with dense representation
      Parameters:
        `A` - transition probability matrix
        `alpha` - initial probability distribution vector

  - ### Method Detail

    - #### Geom

          public static DenseDiscPhaseVar Geom(double p)

      Discrete Phase distribution that represents a geometric distribution with probability of success p
      Parameters:
        `p` - probability of success
      Returns:
        Dense Discrete Phase-Type Distribution

    - #### NegativeBinomial

          public static DenseDiscPhaseVar NegativeBinomial(double p,
                                           int r)

      Discrete Phase Distribution that represents a Negative Binomial distribution with parameters p and r
      Parameters:
        `p` - probability of success in one trial
        `r` - number of successes until absorption
      Returns:
        Dense Discrete Phase-Type 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
      See Also:
        `PhaseVar.getMatrix()`

    - #### 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
      See Also:
        `PhaseVar.getVector()`

    - #### 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
      Specified by:
        `setMatrix` in interface `PhaseVar`
      Parameters:
        `A` - Transition matrix for the transient states of the Phase-Type Distribution
      See Also:
        `PhaseVar.setMatrix(no.uib.cipr.matrix.Matrix)`

    - #### setVector

          public void setVector(no.uib.cipr.matrix.Vector alpha)

      Description copied from interface: `PhaseVar`
      Sets the initial probability vector to be alpha
      Specified by:
        `setVector` in interface `PhaseVar`
      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
      Specified by:
        `copy` in interface `DiscPhaseVar`
      Specified by:
        `copy` in interface `PhaseVar`
      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
      Specified by:
        `newVar` in interface `DiscPhaseVar`
      Parameters:
        `n` - number of Phases of the new Variable
      Returns:
        A new variable of the same class of the original Discrete Phase-Type Variable