Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Plot Markov chain directed graph

`graphplot(mc)`

`graphplot(mc,Name,Value)`

`h = graphplot(___)`

`graphplot(`

creates a plot of the
directed graph (digraph) of the discrete-time Markov chain
`mc`

)`mc`

. Nodes correspond to the states of `mc`

.
Directed edges correspond to nonzero transition probabilities in the transition
matrix `mc.P`

.

`graphplot(`

uses additional
options specified by one or more `mc`

,`Name,Value`

)`Name,Value`

pair arguments. Options include highlighting transition probabilities,
communicating classes, and class properties of recurrence/transience and period.
Also, you can plot the condensed digraph instead, with communicating classes as
*supernodes*.

To produce the directed graph as a MATLAB

^{®}`digraph`

object, and utilize additional functions of that object, enterG = digraph(mc.P)

For readability, the

`'LabelNodes'`

name-value pair argument allows lengthy node labels to be turned off and replaced by node numbers. To remove node labels completely, set`h.NodeLabel = {};`

.To compute node information on communicating classes and their properties, use

`classify`

.To extract a communicating class in the graph, use

`subchain`

.The condensed graph is useful for:

Identifying transient classes (supernodes with positive outdegree)

Identifying recurrent classes (supernodes with zero outdegreee)

Visualizing the overall structure of unichains (chains with a single recurrent class and any transient classes that transition into it).

[1]
Gallager, R.G. *Stochastic Processes: Theory for Applications.* Cambridge, UK: Cambridge University Press, 2013.

[2]
Horn, R. and C. R. Johnson. *Matrix Analysis.* Cambridge, UK: Cambridge University Press, 1985.

[3]
Jarvis, J. P. and D.
R. Shier. "Graph-Theoretic Analysis of Finite Markov Chains." In *Applied Mathematical
Modeling: A Multidisciplinary Approach.* Boca Raton: CRC Press, 2000.

Was this topic helpful?