[][src]Crate mkv_chain

A Markov chain is a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.

Example

    let t_mat = Matrix3::new(  // Transition Matrix
      [[0.9, 0.0, 0.1],
       [0.1, 0.3, 0.6],
       [0.0, 0.1, 0.9]],
   );
   let initial = Vec3::new([0.1, 0.3, 0.6]); // Initial State
   let mvc = MarkovChain3::from(t_mat, initial);
   assert_eq!(
       mvc.take_to(3),
       Vec3::new([0.12250000000000001, 0.11130000000000001, 0.7662])
   );

Modules

linalg

Algebra module for MarkovChains.

Macros

markovchain

Generate a markov chain from matrix and vec identifiers.

matrix

Generate code for a quare matrix with name, order and inner type

vector

Generate code for a vector with name and order

Structs

MarkovChain2

MarkovChain with two nodes.

MarkovChain3

MarkovChain with three nodes.

MarkovChain4

MarkovChain with four nodes.

MarkovChain5

MarkovChain with five nodes.

MarkovChain6

MarkovChain with six nodes.