From the documentation for DiscreteMarkovProcess
, you can come up with this:
Graph[proc, GraphStyle -> "DiagramBlue",
EdgeLabels ->
With[{sm = MarkovProcessProperties[proc, "TransitionMatrix"]},
Flatten@Table[DirectedEdge[i, j] -> sm[[i, j]], {i, 2}, {j, 2}]],
VertexLabels -> {1 -> "A", 2 -> "E"}
]
I took the liberty of changing how the vertices are labeled (otherwise the edge label commands would become unnecessarily further complicated).
Considering that's how it's done in the documentation, I suspect this is the cleanest way to do it canonically. There may be a better hack that might pick apart the Markov process data structure and piece together a graph, but this is how Mathematica devs seem to have intended it.
SECOND VERSION
Based on comments following the question, perhaps a different approach would help.
This time I will try to be "constructive" in some sense. Let's start with the probabilities:
proc = {{0.6, 0.4}, {0.3, 0.7}};
Now, you want to create your edge labels as a table. Every individual edge label will be of the form:
DirectedEdge[2,2] -> 0.7
Since that is the (2,2) entry in your matrix of probabilities. To construct that table:
edge = Table[DirectedEdge[i, j] -> prob[[i, j]],
{i, 1, Length[prob]}, {j, 1, Length[prob[[i]]]}];
Here we use Length[prob]
etc. to make sure our indices are right, but you can also just do:
edge = Table[DirectedEdge[i, j] -> prob[[i, j]], {i, 1, 2}, {j, 1, 2}];
That list, however, is still in an array/matrix format. So we flatten it:
edge = Flatten[edge];
Finally, we need some vertex labels to go with it:
vert = {1 -> "A", 2 -> "E"};
And now we are done:
proc = DiscreteMarkovProcess[1, prob];
Graph[proc, VertexLabels -> vert, EdgeLabels -> edge, GraphStyle -> "DiagramBlue"]