jphase

## Interface DiscPhaseVar

- All Superinterfaces:
    JMarkovElement, PhaseVar
  All Known Implementing Classes:
    AbstractDiscPhaseVar, DenseDiscPhaseVar, SparseDiscPhaseVar

      public interface DiscPhaseVar
      extends PhaseVar

  This interface defines the behaviour that any Discrete Phase-Type distribution should have
  Author:
    Juan F. Perez, German Riano. Universidad de los Andes. (C) 2006

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DiscPhaseVar` | `copy()` Creates a deep copy of the original Phase-Type Variable
    `DiscPhaseVar` | `max(DiscPhaseVar B)` Returns the maximum between the variable B and the original: res = max(A,B)
    `DiscPhaseVar` | `max(DiscPhaseVar B, DiscPhaseVar res)` Returns the maximum between the variable B and the original: res = max(A,B)
    `DiscPhaseVar` | `min(DiscPhaseVar B)` Returns the minimum between the variable B and the original: res = min(A,B)
    `DiscPhaseVar` | `min(DiscPhaseVar B, DiscPhaseVar res)` Returns the minimum between the variable B and the original: res = min(A,B)
    `DiscPhaseVar` | `mix(double p, DiscPhaseVar B)` Computes the distribution of the mix: res = A*p + B*(1-p)
    `DiscPhaseVar` | `mix(double p, DiscPhaseVar B, DiscPhaseVar res)` Computes the distribution of the mix: res = A*p + B*(1-p)
    `DiscPhaseVar` | `newVar(int n)` Creates a new variable of the same class of the original Discrete Phase-Type Variable
    `double` | `pmf(int k)` Evaluates the probability mass function at k
    `double[]` | `pmf(int n, int delta)` Evaluates the probability mass function at n values of x, from zero to n times delta
    `DiscPhaseVar` | `sum(DiscPhaseVar B)` Computes the sum of variables: res = A +B
    `DiscPhaseVar` | `sum(DiscPhaseVar B, DiscPhaseVar res)` Computes the sum of variables: res = A +B
    `DiscPhaseVar` | `sumGeom(double p)` Returns the sum of a geometric number of independent copies of this variable
    `DiscPhaseVar` | `sumPH(DiscPhaseVar B)` Returns the sum of a Phase-type-distributed number of Discrete Phase-type distributions
    `DiscPhaseVar` | `sumPH(DiscPhaseVar B, DiscPhaseVar res)` Returns the sum of a Phase-type-distributed number of Discrete Phase-type distributions
    `java.lang.String` | `toString()` This method returns a short String used in the user interface to describe this element.

    - ### Methods inherited from interface jphase.PhaseVar

      `cdf, cdf, CV, expectedValue, getMat0, getMat0Array, getMatrix, getMatrixArray, getNumPhases, getVec0, getVector, getVectorArray, lossFunction1, lossFunction2, median, moment, prob, quantil, setMatrix, setVector, stdDeviation, survival, survival, variance`

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

      `description, equals, label`

- - ### Method Detail

    - #### sumPH

          DiscPhaseVar sumPH(DiscPhaseVar B,
                           DiscPhaseVar res)

      Returns the sum of a Phase-type-distributed number of Discrete Phase-type distributions
      Parameters:
        `B` - Discrete-Phase Type Distribution that determines the number of Discrete Phase-Type Distributions to sum
        `res` - Discrete Phase Variable to store the resulting distribution
      Returns:
        Sum of a Phase number of Discrete Phase-type distributions

    - #### sumPH

          DiscPhaseVar sumPH(DiscPhaseVar B)

      Returns the sum of a Phase-type-distributed number of Discrete Phase-type distributions
      Parameters:
        `B` - Discrete-Phase Type Distribution that determines the number of Discrete Phase-Type Distributions to sum
      Returns:
        Sum of a Phase number of Discrete Phase-type distributions

    - #### pmf

          double pmf(int k)

      Evaluates the probability mass function at k
      Parameters:
        `k` - Evaluation point
      Returns:
        Evaluation of the probability mass function at k

    - #### pmf

          double[] pmf(int n,
                     int delta)

      Evaluates the probability mass function at n values of x, from zero to n times 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

    - #### sum

          DiscPhaseVar sum(DiscPhaseVar B,
                         DiscPhaseVar res)

      Computes the sum of variables: res = A +B
      Parameters:
        `B` - Variable to sum to the original
        `res` - Variable to store the result
      Returns:
        Sum of Variables: res = A +B

    - #### sum

          DiscPhaseVar sum(DiscPhaseVar B)

      Computes the sum of variables: res = A +B
      Parameters:
        `B` - Variable to sum to the original
      Returns:
        Sum of Variables: res = A +B

    - #### sumGeom

          DiscPhaseVar sumGeom(double p)

      Returns the sum of a geometric number of independent copies of this variable
      Parameters:
        `p` - Parameter of the geometric variable
      Returns:
        Sum of a geometric number of independent copies of this variable

    - #### mix

          DiscPhaseVar mix(double p,
                         DiscPhaseVar B,
                         DiscPhaseVar res)

      Computes the distribution of the mix: res = A*p + B*(1-p)
      Parameters:
        `B` - Variable to mix with the original
        `p` - Portion of this variable in the mix (0<=p<=1)
        `res` - Variable to store the resulting distribution with the same number of phases of the original distribution
      Returns:
        Distribution of the mix: res = A*p + B*(1-p)

    - #### mix

          DiscPhaseVar mix(double p,
                         DiscPhaseVar B)

      Computes the distribution of the mix: res = A*p + B*(1-p)
      Parameters:
        `B` - Variable to mix with the original
        `p` - Portion of this variable in the mix (0<=p<=1) with the same number of phases of the original distribution
      Returns:
        Distribution of the mix: res = A*p + B*(1-p)

    - #### min

          DiscPhaseVar min(DiscPhaseVar B,
                         DiscPhaseVar res)

      Returns the minimum between the variable B and the original: res = min(A,B)
      Parameters:
        `B` - Variable to compare with the original
        `res` - Variable to store the resulting distribution
      Returns:
        res = min(A,B)

    - #### min

          DiscPhaseVar min(DiscPhaseVar B)

      Returns the minimum between the variable B and the original: res = min(A,B)
      Parameters:
        `B` - Variable to compare with the original
      Returns:
        res = min(A,B)

    - #### max

          DiscPhaseVar max(DiscPhaseVar B,
                         DiscPhaseVar res)

      Returns the maximum between the variable B and the original: res = max(A,B)
      Parameters:
        `B` - Variable to compare with the original
        `res` - Variable to store the resulting distribution
      Returns:
        res = max(A,B)

    - #### max

          DiscPhaseVar max(DiscPhaseVar B)

      Returns the maximum between the variable B and the original: res = max(A,B)
      Parameters:
        `B` - Variable to compare with the original
      Returns:
        res = max(A,B)

    - #### copy

          DiscPhaseVar copy()

      Creates a deep copy of the original Phase-Type Variable
      Specified by:
        `copy` in interface `PhaseVar`
      Returns:
        A deep copy of the original Phase-Type Variable

    - #### newVar

          DiscPhaseVar newVar(int n)

      Creates a new variable of the same class of the original Discrete Phase-Type Variable
      Parameters:
        `n` - number of Phases of the new Variable
      Returns:
        A new variable of the same class of the original Discrete Phase-Type Variable

    - #### toString

          java.lang.String toString()

      Description copied from interface: `JMarkovElement`
      This method returns a short String used in the user interface to describe this element. It is highly recommended that every class calls label(), using the following code:

           public final String toString() {
               return label();
           }

      Specified by:
        `toString` in interface `JMarkovElement`
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A String label.
      See Also:
        `JMarkovElement.label()`