MarkovChain

scalation.simulation.state.MarkovChain
class MarkovChain(a: MatrixD)

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

Value parameters

a

the transition probability matrix

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def animate(): Unit

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

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

Attributes

def isStochastic: Boolean

Check whether the transition matrix is stochastic (i.e., square, nonnegative, and rows sum to one).

Check whether the transition matrix is stochastic (i.e., square, nonnegative, and rows sum to one).

Attributes

def limit: VectorD

Compute the limiting probabilistic state π * a^k as k -> infinity, by solving a left eigenvalue problem: π = π * a => π * (a - I) = 0, where the eigenvalue is 1. Solve for π by computing the left nullspace of the a - I matrix and then normalize π so it adds to 1.

Compute the limiting probabilistic state π * a^k as k -> infinity, by solving a left eigenvalue problem: π = π * a => π * (a - I) = 0, where the eigenvalue is 1. Solve for π by computing the left nullspace of the a - I matrix and then normalize π so it adds to 1.

Attributes

def next(π: VectorD): VectorD

Compute the next probabilistic state π * a.

Compute the next probabilistic state π * a.

Value parameters

π

the current state probability vector

Attributes

def next(π: VectorD, k: Int): VectorD

Compute the k-th next probabilistic state π * a^k.

Compute the k-th next probabilistic state π * a^k.

Value parameters

k

compute for the k-th time-step/epoch

π

the current state probability vector

Attributes

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.

Value parameters

endTime

the end time for the simulation

i0

the initial/start state

Attributes

override def toString: String

Convert this discrete-time Markov Chain to a string.

Convert this discrete-time Markov Chain to a string.

Attributes

Definition Classes
Any