马尔可夫链的状态转移图

假设以下矩阵是与马尔可夫链相关联的转移概率矩阵。

    0.5   0.2  0.3
P=  0.0   0.1  0.9
    0.0   0.0  1.0

为了研究马尔可夫链状态的性质,绘制了马尔可夫链的状态转移图。

\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,positioning}
\begin{tikzpicture}[->,>=stealth',shorten >=2pt, line width=3pt, 
                                  node distance=2cm, style ={minimum size=20mm}]
\tikzstyle{every node}=[font=\huge]
\node [circle, draw] (a) {1};
\path  (a) edge [loop above] (a);
\node [circle, draw] (b) [right=of a] {2};
\path  (b) edge [loop above] (b);
\draw[->] (a) -- (b);
\node [circle, draw] (c) [below=of a] {3};
\path  (c) edge [loop below] (c);
\draw[->] (a) -- (c);
\draw[->] (b) -- (c);
\end{tikzpicture}

StackOverflow 文档