Template:Short description Template:Use dmy dates Template:For In mathematics, a stochastic matrix is a square matrix used to describe the transitions of a Markov chain. Each of its entries is a nonnegative real number representing a probability.<ref>Template:Cite book</ref><ref name=":1">Template:Cite book</ref>Template:Rp It is also called a probability matrix, transition matrix, substitution matrix, or Markov matrix. The stochastic matrix was first developed by Andrey Markov at the beginning of the 20th century, and has found use throughout a wide variety of scientific fields, including probability theory, statistics, mathematical finance and linear algebra, as well as computer science and population genetics. There are several different definitions and types of stochastic matrices:

  • A right stochastic matrix is a square matrix of nonnegative real numbers, with each row summing to 1 (so it is also called a row stochastic matrix).
  • A left stochastic matrix is a square matrix of nonnegative real numbers, with each column summing to 1 (so it is also called a column stochastic matrix).
  • A doubly stochastic matrix is a square matrix of nonnegative real numbers with each row and column summing to 1.
  • A substochastic matrix is a real square matrix whose row sums are all <math>\le1.</math>

In the same vein, one may define a probability vector as a vector whose elements are nonnegative real numbers which sum to 1. Thus, each row of a right stochastic matrix (or column of a left stochastic matrix) is a probability vector. Right stochastic matrices act upon row vectors of probabilities by multiplication from the right (hence their name) and the matrix entry in the Template:Mvar-th row and Template:Mvar-th column is the probability of transition from state Template:Mvar to state Template:Mvar. Left stochastic matrices act upon column vectors of probabilities by multiplication from the left (hence their name) and the matrix entry in the Template:Mvar-th row and Template:Mvar-th column is the probability of transition from state Template:Mvar to state Template:Mvar.

This article uses the right/row stochastic matrix convention.

HistoryEdit

The stochastic matrix was developed alongside the Markov chain by Andrey Markov, a Russian mathematician and professor at St. Petersburg University who first published on the topic in 1906.<ref name=":0">Template:Cite journal</ref> His initial intended uses were for linguistic analysis and other mathematical subjects like card shuffling, but both Markov chains and matrices rapidly found use in other fields.<ref name=":0" /><ref>Charles Miller Grinstead; James Laurie Snell (1997). Introduction to Probability. American Mathematical Soc. pp. 464–466. Template:Isbn.</ref>

Stochastic matrices were further developed by scholars such as Andrey Kolmogorov, who expanded their possibilities by allowing for continuous-time Markov processes.<ref>Template:Cite journal</ref> By the 1950s, articles using stochastic matrices had appeared in the fields of econometrics<ref>Template:Cite journal</ref> and circuit theory.<ref>Template:Cite journal</ref> In the 1960s, stochastic matrices appeared in an even wider variety of scientific works, from behavioral science<ref>Template:Cite journal</ref> to geology<ref>Template:Cite journal</ref><ref>Template:Cite journal</ref> to residential planning.<ref>Template:Cite journal</ref> In addition, much mathematical work was also done through these decades to improve the range of uses and functionality of the stochastic matrix and Markovian processes more generally.

From the 1970s to present, stochastic matrices have found use in almost every field that requires formal analysis, from structural science<ref>Template:Cite journal</ref> to medical diagnosis<ref>Template:Cite journal</ref> to personnel management.<ref>Template:Cite journal</ref> In addition, stochastic matrices have found wide use in land change modeling, usually under the term Markov matrix.<ref>Template:Cite journal</ref>

Definition and propertiesEdit

A stochastic matrix describes a Markov chain Template:Math over a finite state space Template:Mvar with cardinality Template:Mvar.

If the probability of moving from Template:Mvar to Template:Mvar in one time step is Template:Math, the stochastic matrix Template:Mvar is given by using Template:Math as the Template:Mvar-th row and Template:Mvar-th column element, e.g.,

<math display="block">P=\left[\begin{matrix} P_{1,1}&P_{1,2}&\dots&P_{1,j}&\dots&P_{1,\alpha}\\ P_{2,1}&P_{2,2}&\dots&P_{2,j}&\dots&P_{2,\alpha}\\ \vdots&\vdots&\ddots&\vdots&\ddots&\vdots\\ P_{i,1}&P_{i,2}&\dots&P_{i,j}&\dots&P_{i,\alpha}\\ \vdots&\vdots&\ddots&\vdots&\ddots&\vdots\\ P_{\alpha,1}&P_{\alpha,2}&\dots&P_{\alpha,j}&\dots&P_{\alpha,\alpha}\\ \end{matrix}\right].</math>

Since the total of transition probability from a state Template:Mvar to all other states must be 1, <math display="block">\forall i \in \{1, \ldots, \alpha\},\quad \sum_{j=1}^\alpha P_{i,j}=1;\,</math> thus this matrix is a right stochastic matrix.

The above elementwise sum across each row Template:Mvar of Template:Mvar may be more concisely written as Template:Math, where Template:Math is the Template:Mvar-dimensional column vector of all ones. Using this, it can be seen that the product of two right stochastic matrices Template:Math and Template:Math is also right stochastic: Template:Math. In general, the Template:Mvar-th power Template:Math of a right stochastic matrix Template:Mvar is also right stochastic. The probability of transitioning from Template:Mvar to Template:Mvar in two steps is then given by the Template:Math-th element of the square of Template:Mvar:

<math display="block">\left(P ^{2}\right)_{i,j}.</math>

In general, the probability transition of going from any state to another state in a finite Markov chain given by the matrix Template:Mvar in Template:Mvar steps is given by Template:Math.

An initial probability distribution of states, specifying where the system might be initially and with what probabilities, is given as a row vector.

A stationary probability vector Template:Mvar is defined as a distribution, written as a row vector, that does not change under application of the transition matrix; that is, it is defined as a probability distribution on the set Template:Math which is also a left eigenvector of the probability matrix, associated with eigenvalue 1:

<math display="block">\boldsymbol{\pi}P=\boldsymbol{\pi}.</math>

File:Karpelevich regions.svg
Karpelevič regions for n = 3 and n = 4.

It can be shown that the spectral radius of any stochastic matrix is one. By the Gershgorin circle theorem, all of the eigenvalues of a stochastic matrix have absolute values less than or equal to one. More precisely, the eigenvalues of <math>n</math>-by-<math>n</math> stochastic matrices are restricted to lie within a subset of the complex unit disk, known as Karpelevič regions.<ref>Template:Cite journal</ref> This result was originally obtained by Fridrikh Karpelevich,<ref>Template:Cite journal</ref> following a question originally posed by Kolmogorov<ref>Template:Cite journal</ref> and partially addressed by Nikolay Dmitriyev and Eugene Dynkin.<ref>Template:Cite journal</ref>

Additionally, every right stochastic matrix has an "obvious" column eigenvector associated to the eigenvalue 1: the vector Template:Math used above, whose coordinates are all equal to 1. As left and right eigenvalues of a square matrix are the same, every stochastic matrix has, at least, a left eigenvector associated to the eigenvalue 1 and the largest absolute value of all its eigenvalues is also 1. Finally, the Brouwer Fixed Point Theorem (applied to the compact convex set of all probability distributions of the finite set Template:Math) implies that there is some left eigenvector which is also a stationary probability vector.

On the other hand, the Perron–Frobenius theorem also ensures that every irreducible stochastic matrix has such a stationary vector, and that the largest absolute value of an eigenvalue is always 1. However, this theorem cannot be applied directly to such matrices because they need not be irreducible. In general, there may be several such vectors. However, for a matrix with strictly positive entries (or, more generally, for an irreducible aperiodic stochastic matrix), this vector is unique and can be computed by observing that for any Template:Mvar we have the following limit,

<math display="block">\lim_{k\rightarrow\infty}\left(P^k \right)_{i,j}=\boldsymbol{\pi}_j,</math>

where Template:Math is the Template:Mvar-th element of the row vector Template:Mvar. Among other things, this says that the long-term probability of being in a state Template:Mvar is independent of the initial state Template:Mvar. That both of these computations give the same stationary vector is a form of an ergodic theorem, which is generally true in a wide variety of dissipative dynamical systems: the system evolves, over time, to a stationary state.


Intuitively, a stochastic matrix represents a Markov chain; the application of the stochastic matrix to a probability distribution redistributes the probability mass of the original distribution while preserving its total mass. If this process is applied repeatedly, the distribution converges to a stationary distribution for the Markov chain.<ref name=":1" />Template:Rp<ref name="Kardar2007">Template:Cite book</ref>Template:Rp

Stochastic matrices and their product form a category, which is both a subcategory of the category of matrices and of the one of Markov kernels.

Example: Cat and mouseEdit

Suppose there is a timer and a row of five adjacent boxes. At time zero, a cat is in the first box, and a mouse is in the fifth box. The cat and the mouse both jump to a random adjacent box when the timer advances. For example, if the cat is in the second box and the mouse is in the fourth, the probability that the cat will be in the first box and the mouse in the fifth after the timer advances is one fourth. If the cat is in the first box and the mouse is in the fifth, the probability that the cat will be in box two and the mouse will be in box four after the timer advances is one. The cat eats the mouse if both end up in the same box, at which time the game ends. Let the random variable K be the time the mouse stays in the game.

The Markov chain that represents this game contains the following five states specified by the combination of positions (cat,mouse). Note that while a naive enumeration of states would list 25 states, many are impossible either because the mouse can never have a lower index than the cat (as that would mean the mouse occupied the cat's box and survived to move past it), or because the sum of the two indices will always have even parity. In addition, the 3 possible states that lead to the mouse's death are combined into one:

  • State 1: (1,3)
  • State 2: (1,5)
  • State 3: (2,4)
  • State 4: (3,5)
  • State 5: game over: (2,2), (3,3) & (4,4).

We use a stochastic matrix, <math>P</math> (below), to represent the transition probabilities of this system (rows and columns in this matrix are indexed by the possible states listed above, with the pre-transition state as the row and post-transition state as the column). For instance, starting from state 1 – 1st row – it is impossible for the system to stay in this state, so <math>P_{11}=0</math>; the system also cannot transition to state 2 – because the cat would have stayed in the same box – so <math>P_{12}=0</math>, and by a similar argument for the mouse, <math>P_{14}=0</math>. Transitions to states 3 or 5 are allowed, and thus <math>P_{13},P_{15}\neq0</math> .

<math display="block"> P = \begin{bmatrix}

   0  & 0    & 1/2  &   0  & 1/2 \\
   0  & 0    & 1    &   0  & 0 \\
 1/4  & 1/4  & 0    & 1/4  & 1/4 \\
   0  & 0    & 1/2  &   0  & 1/2 \\
   0  & 0    & 0    &   0  & 1

\end{bmatrix}.</math>

Long-term averagesEdit

No matter what the initial state, the cat will eventually catch the mouse (with probability 1) and a stationary state π = (0,0,0,0,1) is approached as a limit. To compute the long-term average or expected value of a stochastic variable <math>Y</math>, for each state <math>S_j</math> and time <math>t_k</math> there is a contribution of <math>Y_{j,k}\cdot P(S=S_j,t=t_k)</math>. Survival can be treated as a binary variable with <math>Y=1</math> for a surviving state and <math>Y=0</math> for the terminated state. The states with <math>Y=0</math> do not contribute to the long-term average.

Phase-type representationEdit

File:Mousesurvival.jpg
The survival function of the mouse. The mouse will survive at least the first time step.

As State 5 is an absorbing state, the distribution of time to absorption is discrete phase-type distributed. Suppose the system starts in state 2, represented by the vector <math>[0,1,0,0,0]</math>. The states where the mouse has perished don't contribute to the survival average so state five can be ignored. The initial state and transition matrix can be reduced to,

<math display="block">\boldsymbol{\tau}=[0,1,0,0], \qquad T=\begin{bmatrix}

   0          & 0           & \frac{1}{2}  &   0\\
   0          & 0           & 1            &   0\\
 \frac{1}{4}  & \frac{1}{4} &           0  & \frac{1}{4}\\
   0          & 0           & \frac{1}{2}  &   0

\end{bmatrix},</math>

and

<math display="block">(I-T)^{-1}\boldsymbol{1} =\begin{bmatrix}2.75 \\ 4.5 \\ 3.5 \\ 2.75\end{bmatrix},</math>

where <math>I</math> is the identity matrix, and <math>\mathbf{1}</math> represents a column matrix of all ones that acts as a sum over states.

Since each state is occupied for one step of time the expected time of the mouse's survival is just the sum of the probability of occupation over all surviving states and steps in time,

<math display="block">E[K]=\boldsymbol{\tau} \left (I+T+T^2+\cdots \right )\boldsymbol{1}=\boldsymbol{\tau}(I-T)^{-1}\boldsymbol{1}=4.5.</math>

Higher order moments are given by

<math display="block">E[K(K-1)\dots(K-n+1)]=n!\boldsymbol{\tau}(I-{T})^{-n}{T}^{n-1}\mathbf{1}\,.</math>

See alsoEdit

ReferencesEdit

Template:Reflist Template:Matrix classes Template:Authority control zh-yue:轉移矩陣