jphase

## Class HypoExponentialVar

- java.lang.Object
- - jphase.AbstractContPhaseVar
  - - jphase.HypoExponentialVar

- All Implemented Interfaces:
    JMarkovElement, ContPhaseVar, PhaseVar

      public class HypoExponentialVar
      extends AbstractContPhaseVar
      implements PhaseVar

  This class allows the creation and manipulation of hypoexponential distributions. The associated matrix has a dense representation
  Version:
    1.0
  Author:
    German Riaño, Juan F. Pérez

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HypoExponentialVar()` Constructor of a hypoexponential variable in dense representation.
    `HypoExponentialVar(double[] lambdas)` Constructor of a hypoexponential variable in dense representation
    `HypoExponentialVar(int n)` Constructor of a hypoexponential variable with n phases in dense representation

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ContPhaseVar` | `copy()` Creates a deep copy of the original Phase-type variable
    `double` | `expectedValue()` Computes the Expected Value of the Phase-type variable
    `double[][]` | `getDMatrix()`
    `double[]` | `getDVector()`
    `double[]` | `getLambdas()` Return the rates associated to each branch
    `no.uib.cipr.matrix.Matrix` | `getMatrix()` Returns the transition matrix of the Phase-Type Distribution
    `int` | `getNumPhases()` Returns the number of phases 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` | `setLambdas(double[] lambdas)` Sets the rates associated to each branch
    `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, getMat0, getMat0Array, getMatrixArray, 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 jphase.PhaseVar

      `cdf, cdf, CV, getMat0, getMat0Array, getMatrixArray, getVec0, getVectorArray, lossFunction1, lossFunction2, median, moment, prob, quantil, stdDeviation, survival, survival, variance`

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

      `description, equals, label, toString`

- - ### Constructor Detail

    - #### HypoExponentialVar

          public HypoExponentialVar()

      Constructor of a hypoexponential variable in dense representation. As default it has just one branch that is taken with probability one. the unique branch has one phase with rate 1 per time unit.

    - #### HypoExponentialVar

          public HypoExponentialVar(int n)

      Constructor of a hypoexponential variable with n phases in dense representation
      Parameters:
        `n` - Total number of phases

    - #### HypoExponentialVar

          public HypoExponentialVar(double[] lambdas)

      Constructor of a hypoexponential variable in dense representation
      Parameters:
        `lambdas` - Rate associated to each branch

  - ### Method Detail

    - #### getLambdas

          public double[] getLambdas()

      Return the rates associated to each branch
      Returns:
        Rate associated to each branch

    - #### setLambdas

          public void setLambdas(double[] lambdas)

      Sets the rates associated to each branch
      Parameters:
        `lambdas` - Rates associated to each branch to set

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

    - #### getDMatrix

          public double[][] getDMatrix()

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

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

    - #### getDVector

          public double[] getDVector()

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

    - #### copy

          public ContPhaseVar copy()

      Description copied from interface: `PhaseVar`
      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

    - #### getNumPhases

          public int getNumPhases()

      Description copied from interface: `PhaseVar`
      Returns the number of phases of the Phase-type distribution
      Specified by:
        `getNumPhases` in interface `PhaseVar`
      Overrides:
        `getNumPhases` in class `AbstractContPhaseVar`
      Returns:
        Number of phases of the Phase-type distribution
      See Also:
        `PhaseVar.getNumPhases()`

    - #### expectedValue

          public double expectedValue()

      Description copied from interface: `PhaseVar`
      Computes the Expected Value of the Phase-type variable
      Specified by:
        `expectedValue` in interface `PhaseVar`
      Overrides:
        `expectedValue` in class `AbstractContPhaseVar`
      Returns:
        Expected Value of the Phase-type variable
      See Also:
        `PhaseVar.expectedValue()`