I can label a DiscreteMarkovProcess
P = {{0, 1/4, 1/2, 1/4, 0, 0}, {0, 1, 0, 0, 0, 0}, {0, 0, 1/3, 0, 2/3,
0}, {0, 0, 0, 0, 0, 1},
{0, 0, 1/4, 0, 3/4, 0}, {1/4, 0, 0, 0, 3/4, 0}};
proc = DiscreteMarkovProcess[1, P];
Graph[proc, EdgeLabels -> {DirectedEdge[i_, j_] :> P[[i, j]]}]
but how to label a ContinuousMarkovProcess
(without using its discrete version)
For example
P = {{-7, 2, 5, 0}, {0, -5, 0, 5}, {0, 0, -2, 2}, {0, 0, 0, 0}};
pr = ContinuousMarkovProcess[{1, 0, 0, 0}, P];
g = Graph[pr, EdgeLabels -> {DirectedEdge[i_, j_] :> P[[i, j]]}]
does not work. Inspired by the discrete answer How do I show the transition probabilities in a graph of a Markov process? I tried
PropertyList[{g, 1 \[DirectedEdge] 2}]
Scan[(PropertyValue[{g, #}, EdgeLabels] =
PropertyValue[{g, #}, "TransitionRate"]) &, EdgeList[g]]
but it does not work.