jphase

## Interface PhaseVar

- All Superinterfaces:
    JMarkovElement
  All Known Subinterfaces:
    ContPhaseVar, DiscPhaseVar
  All Known Implementing Classes:
    AbstractContPhaseVar, AbstractDiscPhaseVar, DenseContPhaseVar, DenseDiscPhaseVar, ErlangCoxianVar, HyperErlangVar, HypoExponentialVar, SparseContPhaseVar, SparseDiscPhaseVar

      public interface PhaseVar
      extends JMarkovElement

  This interface defines the methods and attributes that any Phase-Type distribution should have
  Version:
    1.0
  Author:
    German Riaño, Juan F. Pérez

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `cdf(double x)` Evaluates the cumulative distribution function at x
    `double[]` | `cdf(int n, double delta)` Evaluates the cumulative distribution function at n values of x, starting with x=0, step delta
    `PhaseVar` | `copy()` Creates a deep copy of the original Phase-type variable
    `double` | `CV()` Computes the Coefficient of Variation of the Phase-type variable
    `double` | `expectedValue()` Computes the Expected Value of the Phase-type variable
    `no.uib.cipr.matrix.Vector` | `getMat0()` Returns the exit vector from the transient states into absorption
    `double[]` | `getMat0Array()` Returns the exit vector in double[] format
    `no.uib.cipr.matrix.Matrix` | `getMatrix()` Returns the transition matrix of the Phase-Type Distribution
    `double[][]` | `getMatrixArray()` Returns the transition matrix in double format
    `int` | `getNumPhases()` Returns the number of phases of the Phase-type distribution
    `double` | `getVec0()` Returns the probability mass at zero (alpha_0)
    `no.uib.cipr.matrix.Vector` | `getVector()` Returns the initial probability mass vector
    `double[]` | `getVectorArray()` Returns the initial probability mass vector in double[] format
    `double` | `lossFunction1(double x)` Evaluates the loss function of order 1 at x
    `double` | `lossFunction2(double x)` Evaluates the loss function of order 2 at x
    `double` | `median()` Computes the median of the distribution
    `double` | `moment(int k)` Compuetes the k-th Moment of the Phase-type variable
    `double` | `prob(double a, double b)` Computes the probability that this variable takes a value between a and b
    `double` | `quantil(double p)` Computes the quantile q of the distribution, such that F(q) = p
    `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
    `double` | `stdDeviation()` Computes the Standard deviation of the Phase-type variable
    `double` | `survival(double x)` Evaluates the survival function at x
    `double[]` | `survival(int n, double delta)` Evaluates the survival function at n values of x, starting with x=0, step delta
    `double` | `variance()` Computes the variance of the Phase-type variable

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

      `description, equals, label, toString`

- - ### Method Detail

    - #### getMatrix

          no.uib.cipr.matrix.Matrix getMatrix()

      Returns the transition matrix of the Phase-Type Distribution
      Returns:
        Transition matrix for transient states of the Phase-Type Distribution

    - #### setMatrix

          void setMatrix(no.uib.cipr.matrix.Matrix A)

      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

          no.uib.cipr.matrix.Vector getVector()

      Returns the initial probability mass vector
      Returns:
        Initial probability mass vector

    - #### setVector

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

      Sets the initial probability vector to be alpha
      Parameters:
        `alpha` - Initial probability mass vector

    - #### getNumPhases

          int getNumPhases()

      Returns the number of phases of the Phase-type distribution
      Returns:
        Number of phases of the Phase-type distribution

    - #### getVec0

          double getVec0()

      Returns the probability mass at zero (alpha_0)
      Returns:
        Probability mass at zero (alpha_0)

    - #### getMat0

          no.uib.cipr.matrix.Vector getMat0()

      Returns the exit vector from the transient states into absorption
      Returns:
        Exit vector from the transient states into absorption

    - #### getMatrixArray

          double[][] getMatrixArray()

      Returns the transition matrix in double format
      Returns:
        Transition matrix for transient states of the Phase-Type Distribution in double[][] format

    - #### getVectorArray

          double[] getVectorArray()

      Returns the initial probability mass vector in double[] format
      Returns:
        Initial probability mass vector in double[] format

    - #### getMat0Array

          double[] getMat0Array()

      Returns the exit vector in double[] format
      Returns:
        Exit vector from the transient states to absorption in double[] format

    - #### copy

          PhaseVar copy()

      Creates a deep copy of the original Phase-type variable
      Returns:
        A deep copy of the original Phase-type variable

    - #### expectedValue

          double expectedValue()

      Computes the Expected Value of the Phase-type variable
      Returns:
        Expected Value of the Phase-type variable

    - #### variance

          double variance()

      Computes the variance of the Phase-type variable
      Returns:
        Variance of the Phase-type variable

    - #### stdDeviation

          double stdDeviation()

      Computes the Standard deviation of the Phase-type variable
      Returns:
        Standard deviation of the Phase-type variable

    - #### CV

          double CV()

      Computes the Coefficient of Variation of the Phase-type variable
      Returns:
        Coefficient of Variation of the Phase-type variable

    - #### moment

          double moment(int k)

      Compuetes the k-th Moment of the Phase-type variable
      Parameters:
        `k` - Moment to compute
      Returns:
        k-th Moment of the Phase-type variable

    - #### cdf

          double cdf(double x)

      Evaluates the cumulative distribution function at x
      Parameters:
        `x` - Evaluation point
      Returns:
        Cumulative density function at x

    - #### cdf

          double[] cdf(int n,
                     double delta)

      Evaluates the cumulative distribution function at n values of x, starting with x=0, step delta
      Parameters:
        `n` - number of evaluation points
        `delta` - distance between evaluation points
      Returns:
        Evaluation of the survival Function at x = 0,d,2d,..,(n-1)d

    - #### prob

          double prob(double a,
                    double b)

      Computes the probability that this variable takes a value between a and b
      Parameters:
        `a` - inferior limit
        `b` - superior limit
      Returns:
        Probability that this variable takes a value between a and b

    - #### survival

          double survival(double x)

      Evaluates the survival function at x
      Parameters:
        `x` - Evaluation point
      Returns:
        Evaluation of the survival Function at x = 1-F(x)=P(X>x)

    - #### survival

          double[] survival(int n,
                          double delta)

      Evaluates the survival function at n values of x, starting with x=0, step delta
      Parameters:
        `n` - number of evaluation points
        `delta` - distance between evaluation points
      Returns:
        Evaluation of the survival Function at x = 0,d,2d,..,(n-1)d

    - #### lossFunction1

          double lossFunction1(double x)

      Evaluates the loss function of order 1 at x
      Parameters:
        `x` - Evaluation point
      Returns:
        Evaluation of the loss function of order 1

    - #### lossFunction2

          double lossFunction2(double x)

      Evaluates the loss function of order 2 at x
      Parameters:
        `x` - Evaluation point
      Returns:
        Evaluation of the loss function of order 2

    - #### quantil

          double quantil(double p)

      Computes the quantile q of the distribution, such that F(q) = p
      Parameters:
        `p` - probability such that F(q) = p
      Returns:
        The quantile q of the distribution, such that F(q) = p

    - #### median

          double median()

      Computes the median of the distribution
      Returns:
        The median of the distribution