Generate a Markov chain characterized by a partially random transition matrix. Also, decrease the number of feasible transitions.
Generate a 4-by-4 matrix of missing (NaN
) values, which represents the transition matrix.
Specify that state 1 transitions to state 2 with probability 0.5, and that state 2 transitions to state 1 with the same probability.
Create a Markov chain characterized by the partially known transition matrix. For the remaining unknown transition probabilities, specify that five transitions are infeasible for 5 random transitions. An infeasible transition is a transition whose probability of occurring is zero.
mc
is a dtmc
object. With the exception of the fixed elements (1,2) and (2,1) of the transition matrix, mcmix
places five zeros in random locations and generates random probabilities for the remaining nine locations. The probabilities in a particular row sum to 1.
Display the transition matrix and plot a digraph of the Markov chain. In the plot, indicate transition probabilities by specifying edge colors.
P = 4×4
0 0.5000 0.1713 0.3287
0.5000 0 0.1829 0.3171
0.1632 0 0.8368 0
0 0.5672 0.1676 0.2652