Packages

class Markov extends Error

The Markov class supports the creation and use of Discrete-Time Markov Chains 'DTMC's. Transient solution: compute the next state 'pp = p * tr' where 'p' is the current state probability vector and 'tr' is the transition probability matrix. Equilibrium solution (steady-state): solve for 'p' in 'p = p * tr'.

Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Markov
  2. Error
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Markov(tr: MatriD)

    tr

    the transition probability matrix

Value Members

  1. def animate(): Unit

    Animate this Markov Chain.

    Animate this Markov Chain. Place the nodes around a circle and connect them if there is a such a transition.

  2. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  3. def isStochastic: Boolean

    Check whether the transition matrix is stochastic.

  4. def limit: VectoD

    Compute the limiting probabilistic state 'p * tr^k' as 'k -> infinity', by solving a left eigenvalue problem: 'p = p * tr' => 'p * (tr - I) = 0', where the eigenvalue is 1. Solve for p by computing the left nullspace of the 'tr - I' matrix (appropriately sliced) and then normalize 'p' so '||p|| = 1'.

  5. def next(p: VectoD, k: Int = 1): VectoD

    Compute the 'k'th next probabilistic state 'p * tr^k'.

    Compute the 'k'th next probabilistic state 'p * tr^k'.

    p

    the current state probability vector

    k

    compute for the 'k'th step/epoch

  6. def simulate(i0: Int, endTime: Int): Unit

    Simulate the discrete-time Markov chain, by starting in state 'i0' and after the state's holding, making a transition to the next state according to the jump matrix.

    Simulate the discrete-time Markov chain, by starting in state 'i0' and after the state's holding, making a transition to the next state according to the jump matrix.

    i0

    the initial/start state

    endTime

    the end time for the simulation

  7. def toString(): String

    Convert 'this' discrete-time Markov Chain to a string.

    Convert 'this' discrete-time Markov Chain to a string.

    Definition Classes
    Markov → AnyRef → Any