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.
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]) );
Algebra module for MarkovChains.
Generate a markov chain from matrix and vec identifiers.
Generate code for a quare matrix with name, order and inner type
Generate code for a vector with name and order
MarkovChain with two nodes.
MarkovChain with three nodes.
MarkovChain with four nodes.
MarkovChain with five nodes.
MarkovChain with six nodes.